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

#include <stdio.h>

#define MAX 100

char field[MAX][MAX];

int flag[MAX];

int main(void)
{
    int h, w;
    
    int i, j;
    int a = 0, b = 0;
    int c = 0;
    
    scanf("%d %d\n", &h, &w);
    
    for(i = 0; i < h; i++) {
        flag[i] = 0;
    }
    
    for(i = 0; i < h; i++) {
        scanf("%s", field[i]);
    }
    
    /*for(i = 0; i < h; i++) {
        for(j = 0; j < w; j++) {
            printf("%c", field[i][j]);
            if(j == w - 1) {
                printf("\n");
            }
        }
    }*/
    
    while(a < h) {
        for(j = 0; j < w; j++) {
            if(field[a][j] == '#') {
                flag[a] = 1;
                break;
            }
            if(j == w - 1) {
                for(i = 0; i < w; i++) {
                    field[a][i] = '\0';
                }
                c++;
                printf("発見:%2d行\n", a);
                //field[a][h] = 'X';
            }
        }
        a++;
    }
    
    while(b < w) {
        for(i = 0; i < h; i++) {
            if(field[i][b] == '#') {
                break;
            }
            if(i == w - 1) {
                for(j = 0; j < w; j++) {
                    field[j][b] = '\0';
                }
                //field[w][b] = 'X';
                printf("発見:%2d列\n", b);
            }
        }
        b++;
    }
    
    
     for(i = 0; i < h; i++) {
         for(j = 0; j < w; j++) {
             printf("%c", field[i][j]);
             if(j == w - 1 && flag[i] == 1) {
                 printf("\n");
             }
         }
     }
    
    return 0;
}