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