n = gets.to_i m = gets.to_i if n / m < 1000 puts "0" exit end if n % m != 0 hideo_num = n.to_s[0].to_i puts hideo_num * 1000 else puts n / m end