import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int e = sc.nextInt();
		sc.close();

		int ab = a + b;
		int cd = c + d;
		int x = lcm(ab, cd);
		int ans = 0;
		for (int i = 0; i < x; i++) {
			if (i % ab < a && i % cd < c) {
				ans++;
			}
		}
		ans *= e / x;
		e %= x;
		for (int i = 0; i < e; i++) {
			if (i % ab < a && i % cd < c) {
				ans++;
			}
		}
		System.out.println(ans);
	}

	static int lcm(long a, long b) {
		BigInteger ba = BigInteger.valueOf(a);
		BigInteger bb = BigInteger.valueOf(b);
		return ba.multiply(bb).divide(ba.gcd(bb)).intValue();
	}
}