#include<iostream>
using namespace std;
class fraction{
private:
long long int a,b;
public:
fraction(long long int a = 0, long long int b = 1)
{
this->a = a;
this->b = b;
}
void show()
{
cout << a << '/' << b;
}
void read()
{
char c;
cin >> a >> c >> b;
}
fraction operator*(fraction other){
return fraction(a * other.a, b * other.b);
}
fraction operator+(fraction other){
return fraction(b * other.a + a * other.b, b * other.b);
}
fraction operator-(fraction other){
return fraction(a * other.b - b * other.a, b * other.b);
}
};
int main(){
fraction x,y;
x.read();
y.read();
(x * y).show();
return 0;
}