You are given two integers K and S.
Three variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.
How many different assignments of values to X, Y and Z are there such that X + Y + Z = S?

Constraints

* 2≤K≤2500
* 0≤S≤3K
* K and S are integers.

Input

The input is given from Standard Input in the following format:


K S


Output

Print the number of the triples of X, Y and Z that satisfy the condition.

Examples

Input

2 2


Output

6


Input

5 15


Output

1
import java.util.*;
public class Main {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		long K = sc.nextInt();
		long S = sc.nextInt();
		long res = 0;
		for(long i = Math.min(K, S); i>=0; i--){
			long v = S-i;
			if(v < K )res+=(v+1);
			else if(v == K) res+=(K+1);
			else if(v <= 2*K){
				long a = v-K;
				res+=K-a+1;
			}
		}
		System.out.println(res);
	}
}