using System; using System.Linq; using System.Collections.Generic; class Program { static void Main() { // Console input var LR = Console.ReadLine().ToCharArray(); int tmp = 1; for (var i = 0; LR.Length > i; i++) { if (LR[i] == 'L') { tmp = tmp + tmp; } else if (LR[i] == 'R') { tmp = tmp + tmp + 1; } } // Console output Console.WriteLine(tmp); } }