import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	}
} Main public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	} main {
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int cards = scan.nextInt(); cards scan.nextInt() scan.nextInt scan String[] cardA = new String[cards]; cardA new String[cards] cards String[] cardB = new String[cards]; cardB new String[cards] cards int scoreA = 0; scoreA 0 int scoreB = 0; scoreB 0 for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		} int i = 0; int i = 0; i 0 i < cards i cards i++ i++ i {
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		} {
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		} cardA[i] = scan.next() cardA[i] cardA i scan.next() scan.next scan cardB[i] = scan.next() cardB[i] cardB i scan.next() scan.next scan if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			} cardA[i].compareTo(cardB[i]) > 0 cardA[i].compareTo(cardB[i]) cardA[i].compareTo cardA[i] cardA i cardB[i] cardB i 0 {
				scoreA += 3;
			} scoreA += 3 scoreA 3 if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			} cardA[i].compareTo(cardB[i]) < 0 cardA[i].compareTo(cardB[i]) cardA[i].compareTo cardA[i] cardA i cardB[i] cardB i 0 { //winner:B
				scoreB += 3;
			} scoreB += 3 scoreB 3 { //drrow
				scoreA += 1;
				scoreB += 1;
			} scoreA += 1 scoreA 1 scoreB += 1 scoreB 1 System.out.println(scoreA + " " + scoreB) System.out.println System.out System System.out scoreA + " " + scoreB scoreA + " " + scoreB scoreA " " scoreB String[] args args public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	}
} public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		int cards = scan.nextInt();
		String[] cardA = new String[cards];
		String[] cardB = new String[cards];
		int scoreA = 0;
		int scoreB = 0;
		for(int i = 0;i < cards;i++)
		{
			cardA[i] = scan.next();
			cardB[i] = scan.next();
			
			if(cardA[i].compareTo(cardB[i]) > 0) //winner:A
			{
				scoreA += 3;
			}else if(cardA[i].compareTo(cardB[i]) < 0){ //winner:B
				scoreB += 3;
			}else{ //drrow
				scoreA += 1;
				scoreB += 1;
			}
		}
		System.out.println(scoreA + " " + scoreB);
	}
}