#include #include using namespace std; using ll=long long; ll gcd(ll x,ll y){ if(y==0) return x; return gcd(y,x%y); } int main(){ ll a,b,c,d,e; cin>>a>>b>>c>>d>>e; ll first=a+b,second=c+d; ll lcm=first*second/gcd(first,second); ll part=0; for(ll t=0;t