import java.util.Scanner; public class sample128 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); if(a <= 1000){ System.out.println(a/b); }else if((a/b) >= 1000){ int komakai = a / b; int kettei = komakai - (a/b)%1000; System.out.println(kettei); } } }