#include<bits/stdc++.h> using namespace std; int main(){ int x=0,n,m; cin>>n>>m; x=n; while(n>m){ n++; x++; n-m; } cout<<x; }