import java.io.File;
import java.io.IOException;
import java.util.*;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	}
} import java.io.File; File java.io import java.io.IOException; IOException java.io import java.util.*; util.* java public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	}
} Main public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	} main {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int p1 = 0 p1 0 p2 = 0; p2 0 for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		} {
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		} String s1 = sc.next(); s1 sc.next() sc.next sc String s2 = sc.next(); s2 sc.next() sc.next sc int comp = s1.compareTo(s2); comp s1.compareTo(s2) s1.compareTo s1 s2 if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			} comp > 0 comp 0 p1 += 3 p1 3 if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			} comp < 0 comp 0 p2 += 3 p2 3 {
				p1++;
				p2++;
			} p1++ p1 p2++ p2 System.out.println(p1 + " " + p2) System.out.println System.out System System.out p1 + " " + p2 p1 + " " + p2 p1 " " p2 String[] args args public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	}
} public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	}
} Main
import java.io.File;
import java.io.IOException;
import java.util.*;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int p1 = 0, p2 = 0;
		
		for(int i = 0; i < n; i++){
			String s1 = sc.next();
			String s2 = sc.next();
			int comp = s1.compareTo(s2);
			if(comp > 0) p1 += 3;
			else if(comp < 0) p2 += 3;
			else{
				p1++;
				p2++;
			}
		}
		
		System.out.println(p1 + " " + p2);
	}
}
