a,b,c,d,e = map(int,input().split()) loop = (a+b)*(c+d) ok = [0] for i in range(1,loop+1): pre = ok[-1] if 0 < i%(a+b) <= a and 0 < i%(c+d) <= c: ok.append(pre+1) else: ok.append(pre) #print(ok) num = e//loop amari = e%loop ans = num*ok[-1] + ok[amari] print(ans)