#include <bits/stdc++.h>
using namespace std;
int n, p, q;
int f(int a, int b)
{
if (b == 0)
return a;
return f(b, a % b);
}
int main()
{
cin >> n;
int fz = 0, fm = 1;
while (n--)
{
scanf("%d/%d", &p, &q);
fz = fz * q + fm * p;
fm = fm * q;
}
int c = f(fz, fm);
fz /= c;
fm /= c;
if (fm != 1)
cout << fz << "/" << fm;
else
cout << fz;
return 0;
}