#include <iostream>
using namespace std;
long gcd(long a, long b){
while (a) {
long t = a;
a = b % a;
b = t;
}
return b;
}
int main(int argc, const char * argv[]) {
int n;
cin >> n;
long a, b, n1, n2;
scanf("%ld/%ld", &a, &b);
for (int i = 0; i < n - 1; i++) {
scanf("%ld/%ld", &n1, &n2);
a = a * n2 + n1 * b;
b = b * n2;
long t0 = gcd(abs(a), abs(b));
a = a / t0;
b = b / t0;
}
n1 = a / b;
n2 = a % b;
if (n2) {
if (n1) {
cout << n1 << ' ';
}
cout << n2 << '/' << b << endl;
}else{
cout << n1 << endl;
}
return 0;
}