#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <unordered_map>
#include <vector>

#define ALL(obj) (obj).begin()(obj).end()
#define DEBUG(x) cerr << #x << " = " << x << endl
#define ll long long

using namespace std;

int main() {
  ll a;
  ll b;
  ll c;
  ll d;
  ll e;
  std::cin >> a >> b >> c >> d >> e;

  const ll both = (a + b) * (c + d);
  ll count = 0;
  for (ll i = 0; i < both; ++i) {
    const bool ok1 = (i % (a + b)) < a;
    const bool ok2 = (i % (c + d)) < c;
    if (ok1 && ok2) {
      count += 1;
    }
  }
  ll ans = (e / both) * count;
  e %= both;
  for (ll i = 0; i < e; ++i) {
    const bool ok1 = (i % (a + b)) < a;
    const bool ok2 = (i % (c + d)) < c;
    if (ok1 && ok2) {
      ans += 1;
    }
  }
  std::cout << ans << std::endl;
}