import java.util.Scanner;
public class Main {
	
	static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	
	static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	}
} Main static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; k {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'} 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z' public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	} main {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn int L = 0; L 0 int R = 0; R 0 for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		} {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		} String s1 = stdIn.next(); s1 stdIn.next() stdIn.next stdIn String s2 = stdIn.next(); s2 stdIn.next() stdIn.next stdIn if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			} s1.compareTo(s2) == 0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
				L++;
				R++;
			} L++ L R++ R if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			} s1.compareTo(s2) < 0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
				L += 3;
			} L += 3 L 3 {
				R += 3;
			} R += 3 R 3 System.out.println(R + " " + L) System.out.println System.out System System.out R + " " + L R + " " + L R " " L String[] args args public class Main {
	
	static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	}
} public class Main {
	
	static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	}
} Main
import java.util.Scanner;
public class Main {
	
	static char[] k = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
	

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int L = 0;
		int R = 0;
		for(int i = 0; i < n; i++) {
			String s1 = stdIn.next();
			String s2 = stdIn.next();
			
			if(s1.compareTo(s2) == 0) {
				L++;
				R++;
			}
			else if(s1.compareTo(s2) < 0) {
				L += 3;
			}
			else {
				R += 3;
			}
		}
		
		System.out.println(R + " " + L);
	}
}