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