program jihanki
  implicit none
  integer :: i, j, n
  integer :: a, b, c
  integer :: count

  read(*,*)a,b,c
  n=a+b
  if (n>=c-1) then
     write(*,*)b+c
  else
     write(*,*)b+n+1
  end if
  
end program jihanki