#include <iostream>
#include <algorithm>
using namespace std;
int x,y;
int main()
{
int n;
cin >> n;
int a,b;
scanf("%d/%d",&a,&b);
x = a,y = b;
n --;
while(n --)
{
int a,b;
scanf("%d/%d",&a,&b);
int a1 = b * x + a * y;
x = a1;
y = b * y;
if(x < 0){
x = -x;
int t = __gcd(x,y);
x = x / t;
y = y / t;
x = -x;
}
else{
int t = __gcd(x,y);
x = x / t;
y = y / t;
}
}
if(y == 1){
cout << x << endl;
}else{
if(x / y){
cout << x / y << ' ' << x - y * (x / y) << '/' << y << endl;
}
else{
cout << x - y * (x / y) << '/' << y << endl;
}
}
return 0;
}