program sample
  implicit none

  integer(8) :: N, L,i
  real(8):: x,y,z,ta,tb
 

  ! 整数を読み込む
  read(*,*) n,l
  x=real(n)
  y=real(l)
  Z=0.0
  do i =1,n
    Z=real(i)+z
  end do
  ta=z/x
 
  i=int(z-ta*(x-1))

  write(*,*) int((z-real(i)) /(x-1))

  stop
end program sample
