from math import gcd

a, b, c, d, e = map(int, input().split())

x = (a+b) * (c+d) // gcd(a+b, c+d)
y = ([True] * a + [False] * b) * (x // (a+b))
z = ([True] * c + [False] * d) * (x // (c+d))

cnt = 0
for i in range(x):
    if not y[i] or not z[i]:
        continue
    cnt += 1

result = e // x * cnt
for i in range(e % x):
    if not y[i] or not z[i]:
        continue
    result += 1

print(result)