#include<iostream> using namespace std; int a[20],b[20]; int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b); } int main() { int n,cnt=0; int n1=0,n2=1,d; char s[20]; cin>>n; while(n--){ cin>>a[cnt]>>s[cnt]>>b[cnt]; cnt++; } for(int i=0;i<cnt;i++){ n2=n2*b[i]; } for(int i=0;i<cnt;i++){ n1=n1+n2*a[i]/b[i]; } d=gcd(n1,n2); n1/=d; n2/=d; if(n2==1) cout<<n1<<endl; else cout<<n1<<"/"<<n2<<endl; return 0; }