using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace YukiCoder { class Program { static void Main(string[] args) { var va = Console.ReadLine().Split().Select(int.Parse) .TakeWhile((d, i) => d == i + 1); Console.WriteLine(va.Count() + 1); Console.ReadLine(); } } }