#include <bits/stdc++.h>
using namespace std;
int func(int n,int t,int a){
if(t == a)
return n;
else if(t < a)
return t + (n - a);
return a + (n - t);
}
int main()
{
int n,t,a;
while(cin>>n>>t>>a){
cout<<func(n,t,a)<<endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int func(int n,int t,int a){
if(t == a)
return n;
else if(t < a)
return t + (n - a);
return a + (n - t);
}
int main()
{
int n,t,a;
while(cin>>n>>t>>a){
cout<<func(n,t,a)<<endl;
}
return 0;
}