#include <bits/stdc++.h>
using namespace std;

void solve(string s){
	vector<int> v;
	for(int i=0; i<s.size(); ++i){
		if(s[s.size()-1-i] == 'n')
			v.push_back(0);
		if(s[s.size()-1-i] == 'w')
			v.push_back(1);
	}
	int a = -1, b = 1;
	if(v[0] == 0) a = 0;
	else a = 90;
	for(int i=1; i<v.size(); ++i){
		b *= 2;
		a *= 2;
		if(v[i] == 0) a -= 90;
		else a += 90;
	}
	if(a % b == 0) cout << a/b << "\n";
	else{
		while(a % 2 == 0 && b % 2 == 0){
			a /= 2;
			b /= 2;
		}
		cout << a << "/" << b << "\n";
	}
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	while(1){
		string s;
		cin >> s;
		if(s == "#") return 0;
		solve(s);
	}
}
