let p,r = printfn "%d",stdin.ReadLine >> int let rec iter n a i = if n>1 then let t = if a<(r ()) then i+1 else i p t iter (n-1) a t let f a = p a iter (r ()) (r ()) a f 1