import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	}
} Main public static void main(String[] args) {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	} main {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	} int score1 = 0 score1 0 score2 = 0; score2 0 Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		} {
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		} String card1 = scan.next(); card1 scan.next() scan.next scan String card2 = scan.next(); card2 scan.next() scan.next scan if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			} card1.compareTo(card2) > 0 card1.compareTo(card2) card1.compareTo card1 card2 0 {
				score1 += 3;
			} score1 += 3 score1 3 if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			} card1.compareTo(card2) == 0 card1.compareTo(card2) card1.compareTo card1 card2 0 {
				score1 += 1;
				score2 += 1;
			} score1 += 1 score1 1 score2 += 1 score2 1 {
				score2 += 3;
			} score2 += 3 score2 3 scan.close() scan.close scan System.out.println(score1 + " " + score2) System.out.println System.out System System.out score1 + " " + score2 score1 + " " + score2 score1 " " score2 String[] args args public class Main {
	public static void main(String[] args) {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	}
} public class Main {
	public static void main(String[] args) {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int score1 = 0, score2 = 0;
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String card1 = scan.next();
			String card2 = scan.next();
			if(card1.compareTo(card2) > 0){
				score1 += 3;
			}else if(card1.compareTo(card2) == 0){
				score1 += 1;
				score2 += 1;
			}else{
				score2 += 3;
			}
		}
		scan.close();
		System.out.println(score1 + " " + score2);
	}
}