#include <stdio.h> int main() { int x, i,j; int mod=1; scanf("%d %d", &x, &i); for (j=1; j<=i; j++) { mod=mod*10; } printf("%d\n",x%mod); return 0; }