n,h,w = gets.chomp.split(/\s/).map{|x| x.to_i}

cnt = 0
for i in 1..n
    a,b = gets.chomp.split(/\s/).map{|x| x.to_i}
    next if a < h or b < w
    aa = a / h
    bb = b / w
    cnt += (aa == 1 or bb == 1) ? 1 : aa*bb
end

puts cnt