import std.stdio, std.conv, std.string, std.algorithm, std.array; void main(){ string[] input = readln.split; auto arr = input.map!(to!int).array; foreach(idx, val; arr){ if(idx+1 != val){ writeln(idx+1); break; } } }