﻿namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class main
	{
		static void Main(string[] args)
		{
//			DietPlan o = new DietPlan();
//			Console.WriteLine(o.chooseDinner("IWANTSODER",
//"SOW",
//"RAT"));

			RoadConstruction o = new RoadConstruction();
			Console.WriteLine(o.getExitTime(new string[]
			{"AAA",
 "A",
 "AAA",
 "A",
 "AAD",
 "A",
 "AAB"}
				));

			Console.ReadLine();
		}
	}
}
