#include int main(){ int w, d; long long int i; scanf("%d%d", &w, &d); for(i = d; i >= 2; i--) w -= w / (i * i); printf("%d\n", w); return 0; }