let get_line () =
    read_line ()
    |> Str.split (Str.regexp " ")

(* use List.cons in 4.03.0 or later *)
let cons elem lst = elem :: lst

let get_sublists lst =
    let rec loop lst acc =
        match lst with
        | [] -> acc
        | x :: xs ->
            loop xs 
                (List.append (List.map (cons x) acc) acc)
    in
    loop lst [[]]

let get_average lst =
    let sum = List.fold_left ( +. ) 0.0 lst in
    sum /. float_of_int (List.length lst)

let print_list lst =
    List.map string_of_float lst
    |> String.concat " "
    |> print_endline

let () =
    let a =
        let [_; a] = get_line () in
        float_of_string a
    in
    let cards =
        get_line ()
        |> List.map float_of_string
    in
    get_sublists cards
    |> List.map get_average
    |> List.filter (fun x -> x = a)
    |> List.length
    |> print_int
    |> print_newline
