output_description: Print the number of the triples of X, Y and Z that satisfy the condition.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      K S
attempt: # include <bits/stdc++.h>
  # define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
  # define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
  # define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
  # define rreps(i, n) for(int i=((int)(n)); i>0; --i)
  # define ALL(x) (x).begin(), (x).end()
  # define SZ(x) ((int)(x).size())
  # define pb push_back
  # define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
  # define MSG(x) std::cout << #x << " : " << x << "\n";
  using namespace std;
  using lint = long long;
  template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
  template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
  
  int main()
  {
      int K, S;
      cin >> K >> S;
  
      int cnt = 0;
  
      rep (X, K+1)
      {
          rep (Y, K+1)
          {
              rep (Z, K+1)
              {
                  if (X + Y + Z == S)
                  {
                      cnt++;
                  }
              }
          }
      }
  
      cout << cnt << "\n";
  
      return 0;
  }
  
problem_description: Statement
  
  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?
samples: [{"input": "2 2", "output": "6\n    \n\nThere are six triples of X, Y and Z that satisfy the condition:\n\n  * X = 0, Y = 0, Z = 2\n  * X = 0, Y = 2, Z = 0\n  * X = 2, Y = 0, Z = 0\n  * X = 0, Y = 1, Z = 1\n  * X = 1, Y = 0, Z = 1\n  * X = 1, Y = 1, Z = 0\n\n* * *"}, {"input": "5 15", "output": "1\n    \n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z."}]