import java.util.*;

class No0128{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int result = (n / 1000) / m;
		if(result > 0){
			result *= 1000;
		}
		System.out.println(result);
	}
}