Problem:
Score : 100 points

Problem Statement

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 1

4 2

Sample Output 1

3

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

Sample Input 2

1 1

Sample Output 2

1

Sample Input 3

15 11

Sample Output 3

5

Solution in Java8 (OpenJDK 1.8.0) (judge verdict: Accepted)

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) throws Exception {
    Code code = new A();
    code.execute();
  }

  public static interface Code {
    void execute() throws IOException;
  }

  static class A implements Code {
    @Override
    public void execute() throws IOException {
      try (IO io = new IO(System.in)) {
        long[] ll = io.nextLong();
        long N = ll[0];
        long i = ll[1];
        System.out.println(solve(N, i));
      }
    }

    public long solve(long N, long i) {
      return N - i + 1;
    }
  }

  public static class IO implements Closeable {
    private BufferedReader buf;

    public IO(InputStream in) {
      buf = new BufferedReader(new InputStreamReader(in));
    }

    public String nextLine() throws IOException {
      return buf.readLine();
    }

    public String[] nextString() throws IOException {
      return nextLine().split(" ");
    }

    public int[] nextInt() throws IOException {
      return Arrays.stream(nextString()).mapToInt(Integer::parseInt).toArray();
    }

    public long[] nextLong() throws IOException {
      return Arrays.stream(nextString()).mapToLong(Long::parseLong).toArray();
    }

    @Override
    public void close() throws IOException {
      buf.close();
    }
  }
}