Problem:

Shopping

You are now in a bookshop with your friend Alice to buy a book, "The Winning Strategy for the Programming Koshien Contest,” just released today. As you definitely want to buy it, you are planning to borrow some money from Alice in case the amount you have falls short of the price. If the amount you receive from Alice still fails to meet the price, you have to abandon buying the book this time.

  Write a program to calculate the minimum amount of money you need to borrow from Alice given the following three items of data: the money you and Alice have now and the price of the book.

Input

  The input is given in the following format.

m f b

A line containing the three amounts of money is given: the amount you have with you now m (0 ≤ m ≤ 10000), the money Alice has now f (0 ≤ f ≤ 10000) and the price of the book b (100 ≤ b ≤ 20000).

Output

Output a line suggesting the minimum amount of money you need to borrow from Alice. Output "NA" if all the money Alice has with him now is not a sufficient amount for you to buy the book.

Sample Input 1

1000 3000 3000

Sample Output 1

2000

Sample Input 2

5000 3000 4500

Sample Output 2

0

Sample Input 3

500 1000 2000

Sample Output 3

NA



Sample input:
1000 3000 3000


Sample output:
2000

Submission status: Wrong Answer

Solution code:
m,f,b=map(int,input().split())
ans=0
if m>b:
    ans=0
elif m<b:
    ans=b-m
elif ans>f:
    ans="NA"
print(ans)

Submission status: Wrong Answer

Solution code:
m,f,b=map(int,input().split())
ans=0
if m>b:
    ans=0
elif m<b:
    ans=b-m
elif m+f<b:
    ans="NA"
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env/ python

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m >= b:
    print(0)
elif b > m+f:
    print("NA")
else:
    print(b-m)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if c <= a:
 print("0")
elif c <= a+b:
 print(c-a)
else:
 print("NA")

Submission status: Accepted

Solution code:
def main():
    m,f,b = map(int,input().split())

    if m+f < b:
        return 'NA'
    return max(0,b-m)

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
print(0 if m >= b else "NA" if m+f < b else b-m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
print("NA" if m+f < b else max(0, b-m))

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
print("NA"*(m+f < b) + (m+f >= b)*str(max(0, b-m)))

Submission status: Accepted

Solution code:
ms = [i for i in map(int,input().split())]
if ms[0] >= ms[2]:
    print(0)
elif ms[0]+ms[1] >= ms[2]:
    print(ms[2]-ms[0])
else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
ans=0
if m+f<b:
    ans= "NA"
elif m>b:
    ans=0
elif m<b:
    ans=b-m

print(ans)

Submission status: Accepted

Solution code:
a,b,c = map(int,list(input().split(" ")))
m = max(0,c-a)
if(a+b>=c):
      print(m)
else:
      print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if(m >= b):
    print(0)
else:
    if(b-m <= f):
        print(b - m)
    else:
        print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
print(max(0, b - m) if b - m <= f else "NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m + f < b:
        print("NA")
elif m >= b:
    print(0)
else:
    print(b - m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
print("NA") if m < b - f else print(max(0, b - m))

Submission status: Accepted

Solution code:
m, f ,b = map(int, input().split())
lending = max(b - m, 0)
if lending <= f:
    print(lending)
else:
    print("NA")

Submission status: Accepted

Solution code:
# coding=utf-8

m, f, b = map(int, input().split())

if m+f < b:
    print("NA")
elif m >= b:
    print(0)
else:
    print(b-m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
print(max(0, b - m) if m + f >= b else "NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

if b <= m:
    print(0)

elif b <= m + f:
    print(b - m)
else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m<b:
    if b-m>f:
        print("NA")
    else:
        print(b-m)
else:
    print(0)

Submission status: Accepted

Solution code:
m,f,b = map(int, input().split())

if m >= b:
    print(0)
elif (m+f) >= b:
    print(b-m)
else:
    print("NA")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if a>=c:
    print(0)
elif a+b>=c:
    print(c-a)
elif a+b<c:
    print("NA")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A=list(map(int, input().split()))

if A[0]+A[1]<A[2]:
    print("NA")
elif A[0]>A[2]:
    print(0)
else:
    print(A[2]-A[0])

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

if m >= b :
    print(0)
elif m+f >= b :
    print(b-m)
else :
    print('NA')

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

if m >= b:
    print("0")
elif m + f >= b:
    print(b - m)
else:
    print("NA")

Submission status: Accepted

Solution code:
M, F, B = map(int, input().split())
if M+F<B:
	print('NA')
else:
	print(max(B-M, 0))

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

if b>m+f:
    print('NA')
else:
    print(max(b-m, 0))

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m >= b:
    print(0)
elif m + f < b:
    print('NA')
else:
    print(b - m)

Submission status: Accepted

Solution code:
m,f,b= map(int,input().split())

if b-m < 0:
    print(0)
elif b-m-f>0:
    print("NA")
else:
    print(b-m)

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m+f>=b:
    if m>b:
        print("0")
    elif m<b:
        print(b-m)
elif m+f<b:
    print("NA")

Submission status: Accepted

Solution code:
m, f, b = list(map(int, input().split()))
if m >= b:
    print(0)
elif (m < b) and (m + f >= b):
    print(b-m)
else:
    print("NA")

Submission status: Accepted

Solution code:
#標準入力
a,b,c = map(int,input().split())

#自分の持っていたお金で足りるなら0を出力する
if a >= c:print("0")

#自分とAのお金を足しても足りないならNAを出力する
elif a + b < c:print("NA")

#上記の2つ以外ならAにいくら借りるかを計算する
else:print(c - a)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

if m + f < b:
    print("NA")
elif m > b:
    print("0")
else:
    print(b - m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m > b:
    print(0)
elif m + f >= b:
    print(b - m)
else:
    print('NA')

Submission status: Accepted

Solution code:
m,f,b = list(map(int, input().split()))

t = b - m
if t>0:
    if t<=f: print(t)
    else: print("NA")
else: print(0)

Submission status: Accepted

Solution code:
import sys
m,f,b=map(int,input().split())
sum1=m+f
if(sum1>=b):
    if(m>=b):
        rental=0
        print(rental)
    else:
        rental=b-m
        print(rental)
else:
    print('NA')

Submission status: Accepted

Solution code:
i = input()
m,f,b = map(int,i.split())
if m >= b:
    print(0)
elif (m+f) < b:
    print('NA')
else:
    print(b - m)

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if b<=m:
    print(0)
elif b<=m+f:
    print(b-m)
else:
    print('NA')

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m >= b:
    print(0)
elif m+f >= b:
    print(b-m)
else:
    print('NA')

Submission status: Accepted

Solution code:
m,f,b = map(int,input().split())
if m+f < b:
    print("NA")
elif m >= b:
    print(0)
else:
    print(b-m)

Submission status: Accepted

Solution code:
m,f,b = [ int(s) for s in input().split() ]
  
x = b-m

if m >= b:
    print(0)
elif f >= x:
    print(x)
else:
    print('NA')

Submission status: Accepted

Solution code:
m, f, b = input().split()
m = int(m)
f = int(f)
b = int(b)

if m >= b:
  print(0)
elif m + f >= b:
  print(b - m)
else:
  print('NA')

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m+f < b:
    print("NA")
elif m>=b:
    print(0)
else:
    print(b-m)

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())

x=b-m
if b<=m:
    print(0)
elif f>=x and 0<=x:
    print(x)
else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m>=b:
    print(0)
elif m+f<b:
    print('NA')
else:
    print(b-m)

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m>=b:
    print(0)
elif m+f>=b:
    g=b-m
    print(g)
else :
    print("NA")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if c <= a:
  print("0")
elif c <= a+b:
  print(c-a)
else:
  print("NA")

Submission status: Accepted

Solution code:

m, f, b = map(int, input().split())
a = b - m

if a <= 0:
    print(0)
elif a <= f:
    print(a)
else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m+f<b:
  print("NA")
elif m>=b:
  print(0)
else:
  print(b-m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m >= b:
  print("0")
elif m < b and m + f >= b:
  print(b-m)
else:
  print("NA")

Submission status: Accepted

Solution code:
a,b,c, = map(int, input().split())
if a>= c:
 print(0)
else:
 d = c - a
 if d <= b:
   print(d)
 else:
   print("NA")

Submission status: Accepted

Solution code:
m,f,b = map(int,input().split())

if m - b > 0:
  print(0)
elif m + f >= b:
  print(b - m)
elif m + f < b:
  print("NA")

Submission status: Accepted

Solution code:
data = input()
my_money, a_money, price = map(int, data.split())
if my_money >= price:
    print(0)
elif my_money < price:
    if (my_money + a_money) >= price:
        print(price - my_money)
    else:
        print('NA')

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if b <= m:
    print(0)
elif b <= m+f:
    print(b-m)
else:
    print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if b - m > 0:
  if f >= b - m:
    print(b - m)
  else:
    print("NA")
else:
  print("0")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m-b>0:
  print(0)
elif m+f>=b:
  print(b-m)
elif m+f<b:
  print('NA')

Submission status: Accepted

Solution code:
m,f,b = map(int, input().split())
if b-m>0 :
  if b-m<=f :
    print(b-m)
  else:
    print('NA')
else:
  print(0)

Submission status: Accepted

Solution code:
m, f, b = map(int,input().split())
 
if m >= b:
  print(0)
if m < b:
  a = b-m
  if b-m <= f:
    print(a)
  else:
    print('NA')

Submission status: Accepted

Solution code:
m,f,b = map(int,input().split())

a = b-m
if f>= a and a > 0 :
     print(a)
elif a<0 :
  print(0)
else :
    print('NA')

Submission status: Accepted

Solution code:
m,f,b = map(int, input(). split())

if b <= m:
  print('0')
elif b-m <= f:
  print(b-m)
else:
  print('NA')

Submission status: Accepted

Solution code:
m,f, b = map(int, input().split())
if b - m > 0:
  if f >= (b - m):
    print(b - m)
  else:
    print("NA")
else:
  print("0")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

x = b - m

if(x <= 0):
    print("0")

elif(x <= f):
    print(x)
    
else:
    print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m  + f < b:
    print("NA")
elif  m >= b:
    print(0)
else:
    print(b - m)

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())

if m>b:
   print(0)

elif b-m<=f:
   print(b-m)
else:
   print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int,input().split())

if m >= b:
  print(0)
if m < b:
  a = b-m
  if b-m <= f:
    print(a)
  else:
    print('NA')

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
if a >= c:
  print(0)
else:
  d = c - a
  if d <= b:
    print(d)
  else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b = map(int, input().split())
if m > b:
    print(0)
else:
    d = b - m
    if d <= f:
        print(d)
    else:
        print("NA")

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
if a >= c:
    print(0)
else:
    d = c - a
    if d <= b:
        print(d)
    else:
        print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if m  + f < b:
    print("NA")
elif  m >= b:
    print(0)
else:
    print(b - m)

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if(m+f<b):
  print("NA")
else:
  if(m>b):
    print(0)
  else:
    print(b-m)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
if a >= c:
  print(0)
else:
  d = c - a
  if b >= d:
    print(d)
  else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b =map(int, input().split())
if m+f<b:
  print("NA")
elif m>=b:
  print("0")
else:
  print(b-m)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
if c <= a:
 print("0")
elif c <= a+b:
 print(c-a)
else:
 print("NA")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m>=b:
  print(0)
elif (m+f)>=b:
  print(b-m)
else:
  print("NA")

Submission status: Accepted

Solution code:
m,a,b=map(int,input().split())
if m>=b:
  print(0)
elif m+a<b:
  print("NA")
else:
  print(b-m)

Submission status: Accepted

Solution code:
a,b,c, = map(int, input().split())
if a>= c:
  print(0)
else:
  d = c - a
  if d <= b:
    print(d)
  else:
    print("NA")

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if(m + f < b) :
  print("NA")
elif(m >= b) :
  print(0)
else :
  print(b - m)

Submission status: Accepted

Solution code:
m, f, b=map(int,input().split(" "))

if m>b:
  print("0")

else:
  if m+f<b:
    print("NA")
  else:
    print(b-m)

Submission status: Accepted

Solution code:
m, f, b = map(int,input().split())
if m >= b:
  print('0')
if m < b <= m + f:
  print(b - m)  
if m + f < b:
  print('NA')

Submission status: Accepted

Solution code:
m,f,b = [int(i) for i in input().split()]

ans = b - m
if ans <= 0:
    print(0)
elif ans <= f:
    print(ans)
else:
    print("NA")

Submission status: Accepted

Solution code:
m,f,b=map(int,input().split())
if m+f<b:
    print('NA')
elif m>b:
    print('0')
else:
    print(b-m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())

if m + f < b:
    print("NA")
elif m >= b:
    print(0)
else:
    print(b - m)

Submission status: Accepted

Solution code:
m, f, b = map(int, input().split())
if b <= m:
    print(0)
elif b <= m + f:
    print(b-m)
else:
    print("NA")

Submission status: Accepted

Solution code:
m, f, b = list(map(int, input().split()))
print('NA' if m+f<b else max(0, b-m))

Submission status: Accepted

Solution code:
m,f,b = map(int,input().split())
if m+f >= b:
    print(max(0,b-m))
else:
    print("NA")