class Solution:
def maxProfit(self , prices ):
# write code here
maxpro = 0
n = len(prices)
for i in range(n-1):
if prices[i+1]>prices[i]:
maxpro+=prices[i+1]-prices[i]
return maxpro