#include <bits/stdc++.h>
#include <string.h>
using namespace std;
typedef long long  ll;
ll apsulutno(double x){
    double pom=x*10;
    ll x1=pom;
    if(x1%10>=1) return (x1/10)+1;
    else return x1/10;
}

int main()
{
   ios::sync_with_stdio(false);
   ll p,q,r,l,d,b=0;
   cin >> p >> q >> r >> l >> d;
   for(double n=l;n<=d;n++){
      double rezp=n/p;
      ll resp=apsulutno(rezp);
      double rezq=n/q;
      ll resq=apsulutno(rezq);
      double rezr=n/r;
      ll resr=apsulutno(rezr);
      if((resp+resq+resr)<=n)
        b++;
}
  cout << b << '\n';
   return 0;
}