Problem:
Score : 100 points

Problem Statement

How many ways are there to choose two distinct positive integers totaling N, disregarding the order?

Constraints

1 \leq N \leq 10^6

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

4

Sample Output 1

1

There is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)

Sample Input 2

999999

Sample Output 2

499999

Solution in C (GCC 5.4.1) (judge verdict: Runtime Error)

    #include <stdio.h>
    #include <math.h>
    #define MAGIC 998244353
    int main(){
    	long n = 0;
    	long d[100000]= {};
    	long floor[100000] = {};
    	long cnt = 0;
    	long i=0; long j = 0;
    	
    	scanf("%ld",&n);
    	
    	for(i=0;i < n;i++){
    		scanf("%ld",&d[i]);
    	}
    	
    	for(i=0;i < n;i++){
    		floor[d[i]]++;
    	}
     
    	if(floor[0] == 1){
    		cnt = 1;
    		for(i=0;i < n-1;i++){
    			if(floor[i] == 0 && floor[i+1] == 0){
                	break;
                }else{
                	for(j = 0;j < floor[i+1];j++){
    					cnt = cnt* floor[i];
                		cnt = cnt  % 998244353;
                	}
    			}
    		}
    	}else{
    		cnt = 0;
    	}
    	cnt = cnt % 998244353;
    	printf("%ld",cnt);	
    	return 0;
    }