#!/usr/bin/perl use strict; use warnings; my $n = <>; my $m = <>; $n /= 1000; my $ans; if($n < $m) { $ans = 0; } else { $ans = $n % $m; $ans = $n - $ans; $ans = $ans / $m; $ans *= 1000; } print "$ans\n"; exit;