from math import gcd A,B,C,D,E = map(int,input().split()) time,count = 1,1 F = (A+B)*(C+D)//gcd((A+B),(C+D)) while time < F: if 0 <= time%(A+B) < A and 0 <= time%(C+D) < C: count += 1 time += 1 ans = count*(E//F) time = 0 while time < (E%F): if 0 <= time%(A+B) < A and 0 <= time%(C+D) < C: ans += 1 time += 1 print(ans)