#include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision using namespace std; int main() { string S; cin >> S; long long int ans = 1; if (S.empty()) { cout << 1 << endl; return 0; } for (unsigned int i = 0; i < S.length(); i++) { if (S[i] == 'L') { ans *= 2; } else { ans = ans * 2 + 1; } } cout << ans << endl; return 0; }