using System; using System.Collections.Generic; class Program { static string InputPattern = "Input5"; static List GetInputList() { var WillReturn = new List(); if (InputPattern == "Input1") { WillReturn.Add("LR"); //5 } else if (InputPattern == "Input2") { WillReturn.Add("RLL"); //12 } else if (InputPattern == "Input3") { WillReturn.Add("RLLRLRLRRRLRL"); //12986 } else if (InputPattern == "Input4") { WillReturn.Add(""); //1 } else { string wkStr; while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr); } return WillReturn; } static void Main() { List InputList = GetInputList(); int CurrRoad = 1; foreach (char EachChar in InputList[0]) { CurrRoad *= 2; if (EachChar == 'R') CurrRoad++; } Console.WriteLine(CurrRoad); } }