#include using namespace std; int main(){ char str[32]; scanf("%s",str); int pos=1; for(int i=0;str[i];i++){ if(str[i]=='L')pos*=2; else pos=pos*2+1; } printf("%d\n",pos); return 0; }