a,b,c,d,e = map(int,input().spilt()) M = (a + b) * (c + d) x = 0 for i in range(1,M + 1): if 0 <(i % (a + b)) <= a and 0 < (i % (c + d)) <= c: x += 1 ans = x * (e // M) e %= M for i in range(1,e + 1): if 0 <(i % (a + b)) <= a and 0 < (i % (c + d)) <= c: ans += 1 print(ans)