program ABC_089_Grouping2
   implicit none
   integer N
   read(*, *) N
   if(mod(N, 3) == 0) then
      write(*, *) N / 3
   else if(mod(N, 3) == 1) then
      write(*, *) (N - 1) / 3
   else 
      write(*, *) (N - 2) / 3
   end if
end program ABC_089_Grouping2