import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import sun.management.resources.agent_sv; public class Main { public static void main(String[] args) { BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(stdReader.readLine()); int[] items = new int[11]; for(int i=0;i 0){ ans += items[i] /2; items[i] %= 2; } sum += items[i]; } ans += sum /4; System.out.println(ans); } catch (IOException e) { e.printStackTrace(); } } }