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