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