import java.util.*;
import java.lang.*;

class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int turns = sc.nextInt();
		int score1 = 0;
		int score2 = 0;
		
		for(int i=0; i<turns; i++){
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		}
		
		
		System.out.printf("%d %d", score1, score2);
		System.out.println();
		
	}
} import java.util.*; util.* java import java.lang.*; lang.* java class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int turns = sc.nextInt();
		int score1 = 0;
		int score2 = 0;
		
		for(int i=0; i<turns; i++){
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		}
		
		
		System.out.printf("%d %d", score1, score2);
		System.out.println();
		
	}
} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int turns = sc.nextInt();
		int score1 = 0;
		int score2 = 0;
		
		for(int i=0; i<turns; i++){
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		}
		
		
		System.out.printf("%d %d", score1, score2);
		System.out.println();
		
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		int turns = sc.nextInt();
		int score1 = 0;
		int score2 = 0;
		
		for(int i=0; i<turns; i++){
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		}
		
		
		System.out.printf("%d %d", score1, score2);
		System.out.println();
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int turns = sc.nextInt(); turns sc.nextInt() sc.nextInt sc int score1 = 0; score1 0 int score2 = 0; score2 0 for(int i=0; i<turns; i++){
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		} int i=0; int i=0; i 0 i<turns i turns i++ i++ i {
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		} {
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		} String word1 = sc.next(); word1 sc.next() sc.next sc String word2 = sc.next(); word2 sc.next() sc.next sc int cp = word1.compareTo(word2); cp word1.compareTo(word2) word1.compareTo word1 word2 if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			} cp < 0 cp 0 {
				score2+=3;
			} score2+=3 score2 3 if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			} cp == 0 cp 0 {
				score1+=1;
				score2+=1;
			} score1+=1 score1 1 score2+=1 score2 1 {
				score1+=3;
			} score1+=3 score1 3 System.out.printf("%d %d", score1, score2) System.out.printf System.out System System.out "%d %d" score1 score2 System.out.println() System.out.println System.out System System.out String[] args args
import java.util.*;
import java.lang.*;

class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int turns = sc.nextInt();
		int score1 = 0;
		int score2 = 0;
		
		for(int i=0; i<turns; i++){
			String word1 = sc.next();
			String word2 = sc.next();
			int cp = word1.compareTo(word2);
			
			if (cp < 0) {
				score2+=3;
			} else if (cp == 0) {
				score1+=1;
				score2+=1;
			} else {
				score1+=3;
			}
			
		}
		
		
		System.out.printf("%d %d", score1, score2);
		System.out.println();
		
	}
}
