#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,a,b;
  cin >> n >> a >> b;
  cout << n - a + b << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (int)n ;i++)
#define rept(i,k,n) for(int i = (int)(k);i < (int)(n);i++)
#define all(vec) vec.begin(),vec.end()
#define ll int64_t
int main(){
    ll a,b,c;
    cin >> a >> b >> c;
    ll k,t;
    int p2,p4;
    if(b%2 == 0){
        p2 = 0;
        if(c >1){
            p4 = 0;
        }
        else{
            if(b%4 == 0){
                p4 = 0;
            }
            else{
                p4 =2;
            }
        }
    }
    else if(b %4 == 1){
        p2 = 1;
        p4 = 1;
    }
    else{
        p2 = 1;
        if(c%2 == 0){
            p4 = 1;
        }
        else{
            p4 = 3;
        }
    }
        k = a%10;
        if(k == 0){
            t = 0;
        }
        if(k == 1){
            t =1;
        }
            if(k == 5){
                t = 5;
            }
            else if(k == 6){
                t = 6;
            }
            else if(k == 4){
                if(p2){
                    t = 4;
                }
                else{
                    t = 6;
                }
            }
            else if(k == 9){
                if(p2){
                    t = 9;
                }
                else{
                    t = 1;
                }
            }
            else if(k == 2){
                if(p4 == 0){
                    t = 6;
                }
                else if(p2 == 0){
                    t = 4;
                }
                else if(p4 == 1){
                    t = 2;
                }
                else{
                    t = 8;
                }
            } 
            else if(k == 3){
                if(p4 == 0){
                    t = 1;
                }
                else if(p2 == 0){
                    t = 9;
                }
                else if(p4 == 1){
                    t = 3;
                }
                else{
                    t = 7;
                }
            }
            else if(k == 7){
                if(p4 == 0){
                    t = 1;
                }
                else if(p2 == 0){
                    t = 9;
                }
                else if(p4 == 1){
                    t = 7;
                }
                else{
                    t = 3;
                }
            }
            else if(k == 8){
                if(p4 == 0){
                    t = 6;
                }
                else if(p2 == 0){
                    t = 4;
                }
                else if(p4 == 1){
                    t = 8;
                }
                else{
                    t = 2;
                }
            }
    cout << t << endl;
}