a, b, c, d, e = map(int, input().split()) l = (a + b) * (c + d) s1 = [False] * l s2 = [False] * l for i in range(l // (a + b)): for j in range(a): s1[i * (a + b) + j] = True for i in range(l // (c + d)): for j in range(c): s2[i * (c + d) + j] = True cnt_loop = sum(b1 and b2 for b1, b2 in zip(s1, s2)) q, r = divmod(e, l) ans = q * cnt_loop + sum(b1 and b2 for b1, b2 in zip(s1[:r], s2[:r])) print(ans)