chomp(my $total = ); chomp(my $num = ); print int($total / ($num*1000))*1000 . "\n";