AtCoder Beginner Contest 107 - Train

There is an N-car train.
You are given an integer i. Find the value of j such that the following statement is true: "the i-th car from the front of the train is the j-th car from the back."

-----Constraints-----
 - 1 \leq N \leq 100
 - 1 \leq i \leq N

-----Input-----
Input is given from Standard Input in the following format:
N i

-----Output-----
Print the answer.

-----Sample Input-----
4 2

-----Sample Output-----
3

The second car from the front of a 4-car train is the third car from the back.

Source: atcoder | Difficulty: EASY


Solutions:
(N, i) = map(int, input().split())
x = N - i + 1
print(x)


(n, i) = map(int, input().split())
print(n - i + 1)


(N, i) = map(int, input().split())
a = N - i + 1
print(a)


(N, i) = map(int, input().split())
j = N - i + 1
print(j)


(a, b) = map(int, input().split())
print(a + 1 - b)


[N, i] = list(map(int, input().split()))
print(N - i + 1)


(N, i) = map(int, input().rstrip().split())
print(N + 1 - i)


print(eval(input().replace(' ', '-') + '+1'))


(N, i) = map(int, input().split())
print(N - i + 1)
exit(0)


(x, y) = input().split(' ')
x = int(x)
y = int(y)
print(x + 1 - y)


(N, i) = [int(x) for x in input().split()]
x = N - i + 1
print(x)


(N, i) = input().split()
A = int(N) - (int(i) - 1)
print(A)


(N, i) = map(int, input().split())
b = N + 1 - i
print(b)


(n, i) = [int(_) for _ in input().split()]
print(n - i + 1)


import sys
stdin = sys.stdin

def ns():
	return stdin.readline().rstrip()

def ni():
	return int(stdin.readline().rstrip())

def nm():
	return list(map(int, stdin.readline().split()))

def nl():
	return list(map(int, stdin.readline().split()))

def main():
	(n, i) = nm()
	print(n - i + 1)

def __starting_point():
	main()
__starting_point()


(N, I) = [int(a) for a in input().split(' ')]
print(N - I + 1)


(n, m) = map(int, input().split())
print(n + 1 - m)


n = [int(i) for i in input().split()]
print(n[0] - n[1] + 1)


(N, i) = [int(ni) for ni in input().split()]
print(N + 1 - i)


(N, M) = [int(x) for x in input().split()]
print(N - M + 1)


(A, B) = map(int, input().split())
print(A - B + 1)


(N, i) = map(int, input().split())
r = N + 1 - i
print(r)


(N, I) = map(int, input().split())
x = N - I
x += 1
print(x)


(N, M) = map(int, input().split())
print(N - M + 1)


a = list(map(int, input().split()))
print(a[0] - a[1] + 1)


(n, k) = map(int, input().split())
print(int(n + 1 - k))


(n, i) = [int(x) for x in input().split()]
print(n + 1 - i)


(N, i) = (int(_) for _ in input().split())
print(N - i + 1)


(a, d) = map(int, input().split())
print(a - d + 1)


(N, Xi) = map(int, input().split())
print(N - Xi + 1)


(n, y) = map(int, input().split())
print(n - y + 1)


s = input()
l = s.split(' ')
print(int(l[0]) - int(l[1]) + 1)


(t, i) = map(int, input().split(' '))
j = t - i + 1
print(j)


a = input().split(' ')
print(int(a[0]) - int(a[1]) + 1)


(N, i) = map(int, input().split())
print(abs(N - i) + 1)


def main():
	(n, i) = list(map(int, input().split()))
	print(n - i + 1)

def __starting_point():
	main()
__starting_point()


def solve():
	(a, b) = map(int, input().split())
	print(a - b + 1)
solve()


y = input().split()
print(int(y[0]) - int(y[1]) + 1)


(a, b) = [int(s) for s in input().split()]
print(a - b + 1)


num = input().split()
print(int(num[0]) - int(num[1]) + 1)


(a, s) = map(int, input().split())
print(int(a - s + 1))


X = list(map(int, input().split()))
print(X[0] - X[1] + 1)


(N, i) = input().split()
a = int(N)
b = int(i)
print(a + 1 - b)


(n, i) = map(int, input().split())
print(n - list(range(1, n + 1)).index(i))


(m, q) = map(int, input().split())
print(m - q + 1)


[a, b] = [int(i) for i in input().split()]
print(a - b + 1)


(p, q) = input().split()
(a, b) = (int(p), int(q))
print(a - b + 1)


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007

def main():
	(N, i) = list(map(int, readline().split()))
	print(N - i + 1)
	return

def __starting_point():
	main()
__starting_point()


def main():
	(a, b) = list(map(int, input().split()))
	print(a - b + 1)
main()


(c, d) = map(int, input().split())
print(c - d + 1)


(N, K) = map(int, input().split())
print(N + 1 - K)


N = list(map(int, input().split()))
print(N[0] - N[1] + 1)


(N, m) = map(int, input().split())
print(N - m + 1)


(N, i) = tuple(map(int, input().split()))
print(N - i + 1)


(n, m) = [int(x) for x in input().split()]
print(n - m + 1)


(n, i) = input().split()
n = int(n)
i = int(i)
m = 1
print(n - i + m)


(k, i) = map(int, input().split())
print(k - i + 1)


(b, c) = map(int, input().split())
print(b - c + 1)


(n, i) = input().split()
j = int(n) - int(i) + 1
print(j)


(N, Y) = [int(i) for i in input().split()]
print(N - Y + 1)


(N, i) = map(int, input().split())
car = N + 1 - i
print(car)


(t, s) = map(int, input().split())
print(t - s + 1)


(N, i) = map(int, str(input()).split())
print(N - i + 1)


a = input().split()
(y, z) = map(int, a)
b = y - z + 1
print(b)


d = [int(i) for i in input().split()]
print(d[0] - d[1] + 1)


(X, t) = map(int, input().split())
print(X - t + 1)


(N, I) = (int(T) for T in input().split())
print(N + 1 - I)


(k, b) = map(int, input().split(' '))
print(k - b + 1)


(N, i) = map(int, input().split())
if N == 1:
	print(1)
elif N == 2:
	if i == 1:
		print(2)
	else:
		print(1)
else:
	print(N - i + 1)


(train_len, target_vehicle) = list(map(int, input().split()))
target_from_backside = train_len - (target_vehicle - 1)
print(target_from_backside)


l = list(map(int, input().split()))
print(l[0] - l[1] + 1)


(n, p) = map(int, input().split())
print(n + 1 - p)


(N, A) = list(map(int, input().split()))
print(N - A + 1)


(n, a) = map(int, input().split())
print(n - a + 1)


(n, I) = input().split()
N = int(n)
i = int(I)
print(N + 1 - i)


(m, i) = map(int, input().split())
print(m + 1 - i)


(N, i) = map(int, input().split())
print(max(1, N - i + 1))


(n, i) = list(map(int, input().split()))
ans = n - i + 1
print(ans)


def mapt(fn, *args):
	return list(map(fn, *args))

def Input():
	return mapt(int, input().split(' '))

def main():
	(n, i) = Input()
	print(n - i + 1)
main()