import java.util.Scanner; public class Main { long N; long M; long Dist; long Digit; long Divide; Scanner sc = new Scanner(System.in); public static void main(String[] args) { new Main().solve(); } void solve() { N = sc.nextLong(); M = sc.nextLong(); Dist = N / M; Digit = (long)Math.log10(Dist) + 1; Divide = 1; for(int i = 0; i < Digit - 1; i ++) { Divide = Divide * 10; } Dist = (Dist / Divide) * Divide; if(Dist < 1000) { System.out.println(0); } else { while(Dist * M < N) { Dist = Dist + 1000; } System.out.println(Dist); } } }