let n, h, w = stdin.ReadLine().Split() |> fun x -> int x.[0], int64 x.[1], int64 x.[2]
[for _ in 1..n -> stdin.ReadLine().Split() |> fun x -> int64 x.[0], int64 x.[1]] |> List.map (fun (a, b) -> min (a / h) (b / w)) |> List.sum |> printfn "%d"