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