#include int main() { int N, M; std::cin >> N >> M; std::cout << N / M - N % M << std::endl; return 0; }