using System; class Program { static void Main(string[] args) { string s = Console.ReadLine(); string[] t = s.Split(' '); for (int i = 0; i < 9; ++i) { if ( int.Parse(t[i]) != (i+1)) { Console.WriteLine("{0}", i+1); break; } } } }