program	main
  implicit none
  integer k,s,i,j
  integer,allocatable::a(:,:)
  read*,k,s
  allocate(a(k+1,k+1))
  forall(i=0:k,j=0:k)a(i+1,j+1)=i+j


  print'(i0)',count(s-a(:,:)>=0.and.s.ge.0)
end program main
