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

public class Main
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	}
}
 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 br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	}
} Main public static void main(String[] args)throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int T=0 T 0 H=0 H 0 n=0; n 0 String[] animal = new String[2]; animal new String[2] 2 n = Integer.parseInt(br.readLine()) n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		} {
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		} animal = br.readLine().split(" ") animal br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3; animal[0].compareTo(animal[1]) == 0 animal[0].compareTo(animal[1]) animal[0].compareTo animal[0] animal 0 animal[1] animal 1 0 {
				T++;
				H++;
			} T++ T H++ H if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3; animal[0].compareTo(animal[1]) > 0 animal[0].compareTo(animal[1]) animal[0].compareTo animal[0] animal 0 animal[1] animal 1 0 T = T + 3 T T + 3 T 3 if(animal[0].compareTo(animal[1]) < 0)	H = H + 3; animal[0].compareTo(animal[1]) < 0 animal[0].compareTo(animal[1]) animal[0].compareTo animal[0] animal 0 animal[1] animal 1 0 H = H + 3 H H + 3 H 3 System.out.println(T + " " + H) System.out.println System.out System System.out T + " " + H T + " " + H T " " H String[] args args public class Main
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	}
} public class Main
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	}
} 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 br = new BufferedReader(new InputStreamReader(System.in));
		int T=0, H=0, n=0;
		String[] animal = new String[2];
		n = Integer.parseInt(br.readLine());

		for(int i=0; i<n; i++)
		{
			animal = br.readLine().split(" ");
			if(animal[0].compareTo(animal[1]) == 0)
			{
				T++;
				H++;
			}
			else if(animal[0].compareTo(animal[1]) > 0)	T = T + 3;
			else if(animal[0].compareTo(animal[1]) < 0)	H = H + 3;
		}
		System.out.println(T + " " + H);
	}
}

