Problem:
Card Game

Taro and Hanako are playing card games. They have n cards each, and they compete n turns. At each turn Taro and Hanako respectively puts out a card.
The name of the animal consisting of alphabetical letters is written on each card, and the bigger one in lexicographical order becomes the winner of that turn. The winner obtains 3 points. In the case of a draw, they obtain 1 point each.

Write a program which reads a sequence of cards Taro and Hanako have and reports the final scores of the game.

Input

In the first line, the number of cards n is given. In the following n lines, the cards for n turns are given respectively. For each line, the first string represents the Taro's card and the second one represents Hanako's card.

Constraints

n ≤ 1000

The length of the string ≤ 100

Output

Print the final scores of Taro and Hanako respectively. Put a single space character between them.

Sample Input

3
cat dog
fish fish
lion tiger

Sample Output

1 7

Solution in C# (judge verdict: Wrong Answer)

using System;

public class Program
{
	public static void Main(string[] args)
	{
		//var ss = new StreamScanner();
		//---------------------------------
		//????????????int, double, string?????????????????£????????????
		string strN = Console.ReadLine();
		int n = int.Parse(strN);
		int hanakoPoint = 0;
		int tarouPoint = 0;
		string[] abc = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
		for (int i = 0; i < n;i++)
		{
			int hanako = 0;
			int tarou = 0;
			string str = Console.ReadLine();
			string[] animals = str.Split(null);
			for (int k = 0; k < animals.Length; k++)
			{
				for (int j = 0; j < abc.Length; j++)
				{
					if (animals[k].Substring(0, 1) == abc[j])
					{
						if (k == 1)
						{
							hanako += j;
						}
						else
						{
							tarou += j;
						}
					}
				}
			}
			if (hanako == tarou)
			{
				hanakoPoint += 1;
				tarouPoint += 1;
			}
			else if (hanako > tarou)
			{
				hanakoPoint += 3;
			}
			else
			{
				tarouPoint += 3;
			}
		}
		Console.WriteLine(tarouPoint+" "+hanakoPoint);

		//int x = ss.Next<int>();
		//double d = ss.Next<double>();
		//string s = ss.Next<string>();

		//?????°???????????????????????¨?????????????????????????????????????????????????´???????
		//int[] array = ss.Next<int>(10);
		//---------------------------------

	}
}
public class StreamScanner
{
	private readonly char[] _c = { ' ' };
	private int _index = -1;
	private string[] _input = new string[0];
	private readonly System.IO.StreamReader _sr = new System.IO.StreamReader(Console.OpenStandardInput());

	public T Next<T>()
	{
		if (_index == _input.Length - 1)
		{
			_index = -1;
			while (true)
			{
				string rl = _sr.ReadLine();
				if (rl == null)
				{
					if (typeof(T).IsClass) return default(T);
					return (T)typeof(T).GetField("MinValue").GetValue(null);
				}
				if (rl != "")
				{
					_input = rl.Split(_c, StringSplitOptions.RemoveEmptyEntries);
					break;
				}
			}
		}
		return (T)Convert.ChangeType(_input[++_index], typeof(T), System.Globalization.CultureInfo.InvariantCulture);
	}

	public T[] Next<T>(int x)
	{
		var ret = new T[x];
		for (var i = 0; i < x; ++i) ret[i] = Next<T>();
		return ret;
	}

	public T[][] Next<T>(int x, int y)
	{
		var ret = new T[y][];
		for (var i = 0; i < y; ++i) ret[i] = Next<T>(x);
		return ret;
	}
}