#include int root(int n, char side[]){ if(n==-1) return 1; if(side[n]=='L') return (root(n-1, side)*2); if(side[n]=='R') return (root(n-1, side)*2 + 1); } int main(void) { // your code goes here int i, n=0; char now, lr[255]={}; scanf("%s",lr); while(lr[n]!=NULL){ n++; } n--; printf("%d",root(n, lr)); return 0; }