#include using namespace std; int main(){ string S; cin >> S; long long X = 1; for( auto c : S){ if( c == 'L' ) X *= 2; else X = X * 2 + 1; } cout << X << endl; }