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

long long gcd(long long a, long long b) {
    if (a == 0 || b == 0) return 1ll;
    while (b) swap(a = a % b, b);
    return a;
}

struct Ratio {
    long long d, n;
    Ratio(long long d_ = 0, long long n_ = 1) : d(d_), n(n_) {}
    Ratio& operator+=(Ratio other) { return *this = reduct(Ratio(d * other.n + other.d * n, n * other.n)); }
    Ratio& operator-=(Ratio other) { return *this = reduct(Ratio(d * other.n - other.d * n, n * other.n)); }
    friend Ratio operator+(const Ratio& lhs, const Ratio& rhs) { Ratio t(lhs); return t += rhs; }
    friend Ratio operator-(const Ratio& lhs, const Ratio& rhs) { Ratio t(lhs); return t -= rhs; }
    friend Ratio reduct(Ratio r) {
        long long g = gcd(r.d, r.n);
        Ratio t(r.d / g, r.n / g);
        if (t.n < 0) t.d = -t.d, t.n = -t.n;
        return t;
    }
    friend ostream& operator<<(ostream& os, const Ratio& r) {
        if (r.n == 1) return os << r.d; return os << r.d << '/' << r.n;
    }
};

inline bool endswith(const string& s, const string& t) {
    return s.size() < t.size() ? false : s.compare(s.size() - t.size(), t.size(), t) == 0;
}

Ratio solve(const string& dir) {
    Ratio a(0);
    for (int l = int(dir.size()), n = 0; l > 0; ++n) {
        if (endswith(dir.substr(0, l), "west")) a += Ratio(90, 1 << n), l -= 4;
        else a -= n ? Ratio(90, 1 << n) : 0, l -= 5;
    }
    return a;
}

int main() {
    for (string dir; cin >> dir, dir != "#";) cout << solve(dir) << endl;
}