#include int main(void) { int W,D,i,x=0; scanf("%d%d",&W,&D); for(i=D;i>1;i--){ x = W/(i*i); W = W-x; } printf("%d\n",W); return 0; }