n = gets.to_i

days3 = [3,13,23,30,31]
days5 = [5,15,25]

point = 0
n.times do |i|
  d, p = gets.chomp.split(" ").map{|x| x.to_i}
  if days3.include?(d)
    point += (p * 3) / 100
  elsif days5.include?(d)
    point += (p * 5) / 100
  else
    point += p / 100
  end
end

puts point
