#include <string>
#include <iostream>
using namespace std;
string s;
pair<int, int> solve(int pos, int cnt) {
	if (s[pos] == 'n') {
		if (cnt == 0) return make_pair(0, 1);
		pair<int, int> ret = solve(pos + 5, cnt - 1);
		if (cnt == 1) return make_pair(ret.first - 45, ret.second);
		return make_pair(ret.first * 2 - 45, ret.second * 2);
	}
	if (cnt == 0) return make_pair(90, 1);
	pair<int, int> ret = solve(pos + 4, cnt - 1);
	if (cnt == 1) return make_pair(ret.first + 45, ret.second);
	return make_pair(ret.first * 2 + 45, ret.second * 2);
}
int main() {
	while (true) {
		cin >> s;
		if (s == "#") break;
		int pos = 0, c = 0;
		while (pos < s.size()) {
			if (s[pos] == 'n') pos += 5;
			else pos += 4;
			c++;
		}
		pair<int, int> ret = solve(0, c - 1);
		if (ret.second == 1) {
			printf("%d\n", ret.first);
		}
		else {
			printf("%d/%d\n", ret.first, ret.second);
		}
	}
	return 0;
}