import java.util.Scanner;

public class Main {
	public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	}
	
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	}
	
} Main public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	} main {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int turn; turn int playerA = 0 playerA 0 playerB = 0; playerB 0 String playerAcard playerAcard playerBcard; playerBcard turn = scan.nextInt() turn scan.nextInt() scan.nextInt scan for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		} int i = 0; int i = 0; i 0 i < turn i turn i++ i++ i {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		} {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		} playerAcard = scan.next() playerAcard scan.next() scan.next scan playerBcard = scan.next() playerBcard scan.next() scan.next scan if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			} playerAcard.compareTo(playerBcard) > 0 playerAcard.compareTo(playerBcard) playerAcard.compareTo playerAcard playerBcard 0 {
				playerA += 3;
			} playerA += 3 playerA 3 if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			} playerAcard.compareTo(playerBcard) == 0 playerAcard.compareTo(playerBcard) playerAcard.compareTo playerAcard playerBcard 0 {
				playerA += 1;
				playerB += 1;
			} playerA += 1 playerA 1 playerB += 1 playerB 1 {
				playerB += 3;
			} playerB += 3 playerB 3 scan.close() scan.close scan System.out.println (playerA + " " + playerB) System.out.println System.out System System.out playerA + " " + playerB playerA + " " + playerB playerA " " playerB String [] args args public class Main {
	public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	}
	
} public class Main {
	public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	}
	
} Main
import java.util.Scanner;

public class Main {
	public static void main(String [] args) {
		
		Scanner scan = new Scanner(System.in);
		int turn;
		int playerA = 0, playerB = 0;
		String playerAcard, playerBcard;
		
		turn = scan.nextInt();
		
		for (int i = 0; i < turn; i++) {
			
			playerAcard = scan.next();
			playerBcard = scan.next();
			
			//判定
			if (playerAcard.compareTo(playerBcard) > 0) {
				playerA += 3;
			} else if (playerAcard.compareTo(playerBcard) == 0){
				playerA += 1;
				playerB += 1;
			} else {
				playerB += 3;
			}
			
		}
		
		scan.close();
		System.out.println (playerA + " " + playerB);
		
		
		
	}
	
}

