#include<bits/stdc++.h> using namespace std; int k; int main(){ double a,b,r;cin>>a>>b; k=a/b; r=a-k*b; printf("%2f",r); }