import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	}
} import java.util.Scanner; Scanner java.util public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	}
} Main public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	} main {
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int p0=0 p0 0 p1=0; p1 0 for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		} {
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		} String in0 = scanner.next(); in0 scanner.next() scanner.next scanner String in1 = scanner.next(); in1 scanner.next() scanner.next scanner if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			} in0.compareTo(in1) == 0 in0.compareTo(in1) in0.compareTo in0 in1 0 {
				p0 += 1;
				p1 += 1;
			} p0 += 1 p0 1 p1 += 1 p1 1 if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			} in0.compareTo(in1) > 0 in0.compareTo(in1) in0.compareTo in0 in1 0 {
				p0 += 3;
			} p0 += 3 p0 3 {
				p1 += 3;
			} p1 += 3 p1 3 System.out.println(p0+" "+p1) System.out.println System.out System System.out p0+" "+p1 p0+" "+p1 p0 " " p1 String[] args args public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	}
} public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	}
} Main
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		
		int n = scanner.nextInt();
		int p0=0, p1=0;
		
		for(int i=0; i<n; i++)
		{
			String in0 = scanner.next();
			String in1 = scanner.next();
			
			if(in0.compareTo(in1) == 0)
			{
				p0 += 1;
				p1 += 1;
			}
			else if(in0.compareTo(in1) > 0)
			{
				p0 += 3;
			}
			else 
			{
				p1 += 3;
			}
		}
		System.out.println(p0+" "+p1);
	}
}