#include<bits/stdc++.h> using namespace std; double a,b; double yu; int k; int main() { cin>>a>>b; k=floor(a/b); yu=a-b*k; cout<<yu; return 0; }