#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REPI(i,a,b) for (ll i=(a);i<(b);i++) #define REP(i,n) REPI(i,0,n) typedef long long int ll; int SURP = 1000000007; int ceil(int a,int b){ return (a+b-1)/b; } ll gcd(ll a,ll b){ ll p; if (b > a){ p = a; a = b; b = p; } while(b != 0){ p = a % b; a = b; b = p; } return a; } int main(){ string S; cin >> S; if (S == ""){ cout << 1 << endl; return 0; } string s2 = "1"; REP(i,(ll)S.length()){ if(S[i] == 'L') s2 += "0"; else s2 += "1"; } long int ret = stol(s2,NULL,2); cout << ret << endl; return 0; }