Go: package main

import "fmt"

func main() {
	var m, a, book int
	fmt.Scan(&m, &a, &book)

	if nokori := m - book; nokori < 0 {
		if nokori = nokori + a; nokori < 0 {
			fmt.Println("NA")
		} else {
			fmt.Println(a - nokori)
		}
	} else {
		fmt.Println(0)
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int a, b, c; cin >> a >> b >> c;
	if(c > a + b){ cout << "NA" << endl; }
	else cout << max(0, c - a) << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int m, f, b;
	cin >> m >> f >> b;

	if (m >= b)
	{
		cout << 0 << endl;
	}
	else if (m + f >= b)
	{
		cout << b - m << endl;
	}
	else
	{
		cout << "NA" << endl;
	}

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    int a,b,c;
    cin >> a >> b >> c;
    if(c <= a)cout << 0 << endl;
    else if(a+b < c)cout << "NA" << endl;
    else cout << c-a << endl;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
	int m, f, b;
	cin >> m >> f >> b;
	int ans = 0;
	if (m < b) {
		ans = b - m;
		if (ans > f) {
			cout << "NA\n";
			return 0;
		}
	}
	cout << ans << endl;
}

C++: #include<iostream>
using namespace std;
int m,f,b,k,n;
int main(){
cin>>m>>f>>b;
k=m-b;
n=(m+f)-b;
if(k>0){
    cout<<0<<endl;
}else if(n>0){
    cout<<b-m<<endl;
}else{
    cout<<"NA"<<endl;
}

return 0;
}

C++: 
#include<iostream>
using namespace std;

int m,f,b;


int main(){
cin>>m>>f>>b;

 if (m+f<b)
   cout<<NA<<endl;
 else
cout<<b-m<<endl;

return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int m,f,b;
    cin>>m>>f>>b;
    if(m>=b){
        cout<<0<<endl;
    }
    else if(m+f>=b){
        cout<<b-m<<endl;
    }
    else {
        cout<<"NA"<<endl;
    }
}

C++: #include <iostream>
#include <algorithm>
using namespace std ;

int main(){
	long long m,f,a;
	cin >> m >> f >> a ;
	if(m+f<a) cout << "NA" << endl ;
	else cout << max(0LL,a-m) << endl ;
}

C++: 
#include<iostream>
using namespace std;

int m,f,b;


int main(){
cin>>m>>f>>b;

 if (m+f<b)
   cout<<NA<<endl;
  if (m>b)
   cout<<0<<endl;
   else 
  cout<<b-m<<endl;

return 0;
}

C++: 
#include<iostream>
using namespace std;

int m,f,b;


int main(){
cin>>m>>f>>b;

 if (m+f<b)
   cout<<"NA"<<endl;
 else
cout<<b-m<<endl;

return 0;
}

C++: #include<iostream>
uisng namespace std;
int main(){

int m,f,b;
cin>>m>>f>>b;
if(m>b)cout<<" 0 "<<endl;
else
if((m+f)>b)cout<<b-m<<endl;
else
cout<<" NA "<<endl;

return 0;
}

C++: #include <bits/stdc++.h>
#include <assert.h>

using namespace std;

int main()
{
	int m, f, b;
	cin >> m >> f >> b;
	if (m + f < b)
		cout << "NA" << endl;
	else
		cout << max(0,b - m) << endl;

	return 0;
}

C++: #include <bits/stdc++.h>
typedef long long ll;
#define ALL(a) a, a+sizeof(a)/sizeof(a[0])
using namespace std;

ll gcd(ll n, ll m) {
	if (m == 0) return n;
	return gcd(m, n % m);
}

ll lcm(ll n, ll m) {
	return m / gcd(n, m) * n;
}

int main(void) {
	int m,f, b;
	cin >> m >> f >> b;
	if (m >= b) {
		cout << 0<<endl;
	}
	else if (m + f >= b) {
		cout << b - m << endl;
	}
	else {
		cout << "NA" << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
   int a,b,c,d,e;
   cin>>a>>b>>c;
   if(c<a){cout<<0<<endl;}else if(a+b-c>-1){cout<<c-a<<endl;}
   if(a+b-c<0){cout<<"NA"<<endl;}
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<int,int> P;
typedef pair<P,P> PP;
const ll MOD=10000;
const ll INF=1000000010;
const int MAX=100001;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
    int m,f,b;
    cin>>m>>f>>b;
    if(m+f<b){
        cout<<"NA"<<endl;
    }else{
        cout<<max(0,b-m)<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int m, f, b;
	cin >> m >> f >> b;
	if (m+f >= b) {
		if (m >=b) {
			cout << 0 << endl;
		}
		else {
			cout << b - m << endl;
		}
	}
	else {
		cout << "NA" << endl;
	}
}

C++: #include<iostream>
using namespace std;

int main(){

	int m, f, b;
	cin >> m >> f >> b;

	// 本を購入できないとき
	if (b > m + f) cout << "NA" << endl;
	// 本を購入できるとき
	else if(b <= m) cout << 0 << endl;  // 自分で購入するとき
	else cout << f - m  << endl;  // 友達から借りたとき

	return 0;
}

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

int main()
{
    int M, F, B;
    cin >> M >> F >> B;
    if(M + F < B) {
        cout << "NA" << endl;
    } else {
        cout << max(0, B - M) << endl;
    }
    return (0);
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <bitset>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define Sort(x) sort((x).begin(),(x).end())
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000009
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef std::pair<int,int> pii;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;


int main(){
    int n,m,p;
    cin>>n>>m>>p;
    if(n+m<p){
        cout<<"NA"<<endl;
        return 0;
    }
    cout<<max(0,p-n)<<endl;
    return 0;
}