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

int main(){
	string s;
	while(cin>>s,s!="#"){
		int a=0,b=1,i=0,c,d;
		vector<int> v;
		while(i<s.size()){
			v.push_back(s[i]=='w'?1:0);
			i+=(s[i]=='w'?4:5);
		}
		reverse(v.begin(),v.end());
		a=v[0];
		for(int j=1;j<v.size();j++){
			a*=2;b*=2;
			a+=(v[j]?1:-1);
		}
		a*=90;c=a;d=b;
		while(d){
			c%=d;
			swap(c,d);
		}
		cout<<a/c;
		if(b!=c)cout<<"/"<<b/c;
		cout<<endl;
	}
}