#include using namespace std; using ll = long long; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ int A,B,C,D; scanf("%d%d%d%d",&A,&B,&C,&D); int E; scanf("%d",&E); int cy = (A+B)*(C+D); int cyans = 0; int ans = 0; rep(t,cy){ int tmp = 1; if(t%(A+B) >= A) tmp = 0; if(t%(C+D) >= C) tmp = 0; cyans += tmp; if(E%cy > t) ans += tmp; } ans += cyans * (E/cy); printf("%d\n",ans); return 0; }