Problem C: 三倍游戏

Problem C: 三倍游戏

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

三倍游戏是一种单人游戏。玩家会得到 lns="http://www.w3.org/1998/Math/MathML">n 个整数。每一轮游戏中,玩家从这些整数中挑出两个数字相加,如果和是 lns="http://www.w3.org/1998/Math/MathML">3 的倍数,可以将这两个数字消除,继续下一轮游戏,否则,结束游戏。

请问玩家最多能进行多少轮游戏?

Input

  • 第一行:单个整数 lns="http://www.w3.org/1998/Math/MathML">n
  • 第二行:lns="http://www.w3.org/1998/Math/MathML">n 个整数玩家得到的数字 lns="http://www.w3.org/1998/Math/MathML">a1,a2,,an
  • 对于 lns="http://www.w3.org/1998/Math/MathML">50% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n1000
  • 对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,lns="http://www.w3.org/1998/Math/MathML">1n100000



Output

  • 单个整数表示答案。

Sample Input Copy

4
1 3 3 2

Sample Output Copy

2