import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int taro_n = 0;
		int hanako_n = 0;

		for(int i = 0; i < n; i++){
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		}

			System.out.println(taro_n + " " + hanako_n);
		}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int taro_n = 0;
		int hanako_n = 0;

		for(int i = 0; i < n; i++){
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		}

			System.out.println(taro_n + " " + hanako_n);
		}
} Main public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int taro_n = 0;
		int hanako_n = 0;

		for(int i = 0; i < n; i++){
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		}

			System.out.println(taro_n + " " + hanako_n);
		} main {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int taro_n = 0;
		int hanako_n = 0;

		for(int i = 0; i < n; i++){
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		}

			System.out.println(taro_n + " " + hanako_n);
		} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int taro_n = 0; taro_n 0 int hanako_n = 0; hanako_n 0 for(int i = 0; i < n; i++){
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		} {
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		} String taro = scanner.next(); taro scanner.next() scanner.next scanner String hanako = scanner.next(); hanako scanner.next() scanner.next scanner if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				taro_n += 3;
			} taro_n += 3 taro_n 3 if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
				hanako_n += 3;
			} hanako_n += 3 hanako_n 3 {
				taro_n ++;
				hanako_n ++;
			} taro_n ++ taro_n hanako_n ++ hanako_n System.out.println(taro_n + " " + hanako_n) System.out.println System.out System System.out taro_n + " " + hanako_n taro_n + " " + hanako_n taro_n " " hanako_n String[] args args
import java.util.Scanner;
import java.util.Arrays;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int taro_n = 0;
		int hanako_n = 0;

		for(int i = 0; i < n; i++){
			String taro = scanner.next();
			String hanako = scanner.next();

			if(taro.compareTo(hanako) > 0){
				taro_n += 3;
			}else if(taro.compareTo(hanako) < 0){
				hanako_n += 3;
			}else{
				taro_n ++;
				hanako_n ++;
			}

		}

			System.out.println(taro_n + " " + hanako_n);
		}
}