using System;
using System.Collections.Generic;

namespace feladat5
{
	class Program
	{
		public static void Main(string[] args)
		{
			string input = Console.ReadLine();
			int ertek = Convert.ToInt32(input);
			for (int i = 0; i < ertek-1; i++) {
				string input2 = Console.ReadLine();
			}
			
			Console.Write((ertek-(ertek%3))/3);
		}
	}
}