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>

int main()
{
  int H, W;
  char a[101][101];
  char aa[101][101];
  char aaa[101][101];
  int i, ii, j, jj, kk;
  
  memset(a, '\0', sizeof(a));
  memset(aa, '\0', sizeof(aa));
  memset(aaa, '\0', sizeof(aaa));
  
  scanf("%d %d", &H, &W);
  getchar();
  
  for(i=0;i<H;i++){
    gets(a[i]);
  }
  
  printf("%d %d\n",H ,W);
  
  ii = 0;
  for(i=0;i<H;i++){
    for(j=0;j<W;j++){
      if(memcmp(&a[i][j],"#",1)==0){
        memcpy(aa[ii],a[i],W);
        ii++;
        break;
      }
    }
  }
  
  jj=0;
  for(j=0;j<W;j++){
    for(i=0;i<ii;i++){
      if(memcmp(&aa[i][j],"#",1)==0){
        for(kk=0;kk<ii;kk++){
          memcpy(&aaa[kk][jj],&aa[kk][j],1);
        }
        jj++;
       break;
      }
    }
  }
  
  for(i=0;i<ii;i++){
    printf("%s\n",&aaa[i][0]);
  }
  
  return 0;
}