#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;

int ten(int d) { int res = 1; rep(i, d)res *= 10; return res; }
int gcd(int a, int b) { if (!b)return a; return gcd(b, a%b); }
int main() {
	string s; cin >> s;
	if ((int)s.find('(') == -1) {
		int d = s.size() - s.find('.') - 1;
		int k = ten(d);
		s.erase(s.begin() + s.find('.'));
		int x = stoi(s);
		int gc = gcd(x, k);
		cout << x / gc << '/' << k / gc << endl;
		return 0;
	}
	int d = s.size() - s.find('(') - 2;
	int k = s.find('(') - s.find('.') - 1;
	int t = ten(d);
	string v = s.substr(0, s.find('('));
	v.erase(v.begin() + v.find('.'));
	int x = stoi(v);
	s.erase(s.begin() + s.find('.'));
	s.erase(s.begin() + s.find('('));
	s.pop_back();
	int y = stoi(s);
	int gc = gcd(ten(d + k) - ten(k), y - x);
	cout << (y - x) / gc << '/' << (ten(d + k) - ten(k)) / gc << endl;
}