#include int beki2(int n){ int i, re = 1; for(i = 0; i < n; i++)re *= 2; return re; } int main(void){ int i; char S[30]; int n, sum; scanf("%s", S); n = 0; while(S[n] != '\0') n++; printf("n = %d\n", n); sum = beki2(n); for(i = 0; i <= n; i++){ if(S[n - i - 1] == 'R') sum += beki2(i); } printf("%d\n", sum); return 0; }