# -*- coding: utf-8 -*- S = input() ans = 1 for c in S: ans = 2*ans if c=='L' else 2*ans+1 print(ans)