#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
pii reduce(pii a){
int x = a.first;
int y = a.second;
int g = gcd(x,y);
x/=g;
y/=g;
return {x,y};
}
pii mul(pii a, pii b){
return reduce(make_pair(a.first * b.first, a.second * b.second));
}
pii add(pii a, pii b){
int d1 = a.second;
int d2 = b.second;
a.first *= d2;
a.second *= d2;
b.first *= d1;
b.second *= d1;
return reduce({a.first + b.first,a.second});
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
string s;
cin >> s;
pii base = {3,2};
pii cur = {0,1};
for(char c : s){
pii v = {c - '0',1};
cur = mul(cur,base);
cur = add(cur,v);
}
if(cur.second == 1){
cout << cur.first << '\n';
}
else{
cout << cur.first/cur.second << ' ' << cur.first%cur.second << '/' << cur.second << '\n';
}
return 0;
}