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 C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<char>> t(h, vector<char>(w));
    for (auto &v: t) for (auto &e: v) cin >> e;

    vector<int> cnth(h, 0), cntw(w, 0);
    for (int i = 0; i < h; ++i) for (int j = 0; j < w; ++j) {
        if (t[i][j] == '#') {
            cnth[i]++;
            cntw[j]++;
        }
    }

    for (int i = 0; i < h; ++i) {
        if (cnth[i] == 0) continue;
        for (int j = 0; j < w; ++j) {
            if (cntw[j] == 0) continue;
            cout << t[i][j];
        }
        cout << endl;
    }

    return 0;
}