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: fn main() {
      let s: i32 = read();
      let k: i32 = read();
      let mut ans = 0;
      for i in 0..k+1 {
          for j in 0..k+1 {
              for l in 0..k+1 {
                  if i+j+l == s {
                      ans += 1;
                  }
              }
          }
      }
      println!("{}", ans);
  }
  
  // 以下関数
  
  use std::io::*;
  use std::str::FromStr;
  pub fn read<T: FromStr>() -> T {
      let stdin = stdin();
      let stdin = stdin.lock();
      let token: String = stdin
          .bytes()
          .map(|c| c.expect("failed to read char") as char)
          .skip_while(|c| c.is_whitespace())
          .take_while(|c| !c.is_whitespace())
          .collect();
      token.parse().ok().expect("failed to parse token")
  }
  
  pub const MOD: u64 = 1_000_000_007;
  
  pub fn is_prime(n: i32) -> bool {
      if n < 2 {
          return false;
      } else if n == 2 {
          return true;
      }
      let mut i = 2;
      while i * i < n {
          if n % i == 0 {
              return false;
          } else {
              i += 1;
              continue;
          }
      }
      true
  }
  
  pub fn lcm(mut n: i32, mut m: i32) -> i32 {
      n = if n > m { m } else { n };
      m = if n > m { n } else { m };
      let mut i = n;
      while i % m != 0 {
          i += n;
      }
      i
  }
  
  pub fn abs(n: i32) -> i32 {
      if n >= 0 {
          n
      } else {
          -n
      }
  }
  
  pub fn max(n: i32, m: i32) -> i32 {
      if n >= m {
          n
      } else {
          m
      }
  }
  
  pub fn min(n: i32, m: i32) -> i32 {
      if n <= m {
          n
      } else {
          m
      }
  }
  
  pub fn factorial(n: u32) -> u32 {
      if n == 0 {
          return 1;
      }
      let mut r = n;
      for i in 0..n - 1 {
          r *= n - i - 1;
      }
      r
  }
  
  pub fn combination(n: u32, m: u32) -> u32 {
      factorial(n) / factorial(m) / factorial(n - m)
  }
  
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."}]