import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	}
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	}
} Main public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	} main {
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	} BufferedReader input = new BufferedReader (new InputStreamReader (System.in)); input new BufferedReader (new InputStreamReader (System.in)) int kaisuu = Integer.parseInt(input.readLine()); kaisuu Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input int pointT = 0; pointT 0 int pointH = 0; pointH 0 for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		} int kai = 0; int kai = 0; kai 0 kai < kaisuu kai kaisuu kai++ kai++ kai {
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		} {
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		} String[] cards = input.readLine().split(" "); cards input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			} int next = 0; int next = 0; next 0 next <= cards[0].length() next cards[0].length() cards[0].length cards[0] cards 0 next++ next++ next {

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			} {

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			} char head = 'a'; head 'a' int tarou = 0; tarou 0 int hanako = 0; hanako 0 int alphabet = 26; alphabet 26 for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				} int num = 0; int num = 0; num 0 num < alphabet num alphabet num++,head++ num++ num head++ head {
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				} {
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				} if(next == cards[0].length())
					{
						tarou = -1;

						break;
					} next == cards[0].length() next cards[0].length() cards[0].length cards[0] cards 0 {
						tarou = -1;

						break;
					} tarou = -1 tarou -1 1 break; if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					} cards[0].charAt(next) == head cards[0].charAt(next) cards[0].charAt cards[0] cards 0 next head {
						tarou = num;

						break;
					} tarou = num tarou num break; head = 'a' head 'a' for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				} int num = 0; int num = 0; num 0 num < alphabet num alphabet num++,head++ num++ num head++ head {
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				} {
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				} if(next == cards[1].length())
					{
						hanako = -1;

						break;
					} next == cards[1].length() next cards[1].length() cards[1].length cards[1] cards 1 {
						hanako = -1;

						break;
					} hanako = -1 hanako -1 1 break; if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					} cards[1].charAt(next) == head cards[1].charAt(next) cards[1].charAt cards[1] cards 1 next head {
						hanako = num;

						break;
					} hanako = num hanako num break; if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				} tarou > hanako tarou hanako {
					pointT = pointT + 3;

					break;
				} pointT = pointT + 3 pointT pointT + 3 pointT 3 break; if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				} tarou < hanako tarou hanako {
					pointH = pointH + 3;

					break;
				} pointH = pointH + 3 pointH pointH + 3 pointH 3 break; if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				} tarou == -1 && hanako == -1 tarou == -1 tarou -1 1 hanako == -1 hanako -1 1 {
					pointT++;

					pointH++;
				} pointT++ pointT pointH++ pointH System.out.println(pointT + " " + pointH) System.out.println System.out System System.out pointT + " " + pointH pointT + " " + pointH pointT " " pointH String[] args args public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	}
} public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		int kaisuu = Integer.parseInt(input.readLine());

		int pointT = 0;

		int pointH = 0;

		//勝負をkaisuu回行う
		for(int kai = 0; kai < kaisuu; kai++)
		{
			String[] cards = input.readLine().split(" ");;

			for(int next = 0; next <= cards[0].length(); next++)
			{

				char head = 'a';

				int tarou = 0;

				int hanako = 0;

				int alphabet = 26;

				//太郎のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[0].length())
					{
						tarou = -1;

						break;
					}

					if(cards[0].charAt(next) == head)
					{
						tarou = num;

						break;
					}
				}

				head = 'a';

				//花子のカードの強さを調べる
				for(int num = 0; num < alphabet; num++,head++)
				{
					if(next == cards[1].length())
					{
						hanako = -1;

						break;
					}

					if(cards[1].charAt(next) == head)
					{
						hanako = num;

						break;
					}
				}

				//得点を振り分ける
				if(tarou > hanako)
				{
					pointT = pointT + 3;

					break;
				}

				else if(tarou < hanako)
				{
					pointH = pointH + 3;

					break;
				}

				else if(tarou == -1 && hanako == -1)
				{
					pointT++;

					pointH++;
				}
			}
		}

		System.out.println(pointT + " " + pointH);
	}
}

