include[HTML_REMOVED]
using namespace std;
int n,m,t,k3,k4;
int main(){
cin>>t>>n>>m;
int k1=n/t;
int k2=m/t;
k3=n%t;
k4=m%t;
if(k3){
if(k1%2==1){
k3=t+1-k3;
}
}else{
if(k1%2==0){
k3=1;
}else k3=t;
k1–;
}
if(k4){
if(k2%2==1){
k4=t+1-k4;
}
}else{
if(k2%2==0){
k4=1;
}else k4=t;
k2–;
}
cout<<abs(k1-k2)+abs(k3-k4);
}