using System; using System.Linq; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var line1 = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToArray(); var b = line1; int result = 0; for (int i = 0;i < b.Length ; i++) { if (b[i] != i + 1) { result = i + 1; break; } } //結果を表示 Console.WriteLine(result); } } }