let n, m, x = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let a_s = Array.init m @@ fun _ -> Scanf.scanf " %d" (+) 0
let _ = for i = 0 to m - 1 do if a_s.(i) > x then (Printf.printf "%d\n" @@ min i @@ m - i; exit 0) done; print_endline "0"