open System

let readInt () = stdin.ReadLine() |> int

let a500 = 4
let b100 = 2
let c50 = 3
let x = 1250

[ for a in [ 0 .. a500 ] do
    for b in [ 0 .. b100 ] do
        for c in [ 0 .. c50 ] do
            yield a * 500 + b * 100 + c * 50 ]
|> List.map (fun sum -> if sum = x then 1 else 0)
|> List.sum
|> printfn "%d"
