import java.util.Scanner;

enum Type{
	SAME,
	A_BIG,
	B_BIG
};

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	}

	//A基準で比較する関数
	public static Type compString(String A,String B){
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	}
} import java.util.Scanner; Scanner java.util enum Type{
	SAME,
	A_BIG,
	B_BIG
} Type SAME SAME A_BIG A_BIG B_BIG B_BIG import java.util.Scanner;

enum T import java.util.Scanner;

enum Type{
	SAME,
	A_BIG,
	B_BIG
};

public class Main {

	public st public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	}

	//A基準で比較する関数
	public static Type compString(String A,String B){
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	}
} Main public static final int BIG_NUM  = 2000000000; BIG_NUM 2000000000 public static final int MOD  = 1000000007; MOD 1000000007 public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	} main {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner String TARO TARO HANAKO; HANAKO int score_TARO = 0 score_TARO 0 score_HANAKO = 0; score_HANAKO 0 for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		} int loop = 0; int loop = 0; loop 0 loop < N loop N loop++ loop++ loop {

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		} {

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		} TARO = scanner.next() TARO scanner.next() scanner.next scanner HANAKO = scanner.next() HANAKO scanner.next() scanner.next scanner switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			} compString(TARO,HANAKO) compString TARO HANAKO case SAME: SAME case SAME: score_TARO += 1 score_TARO 1 score_HANAKO += 1 score_HANAKO 1 break; case A_BIG: A_BIG case A_BIG: score_TARO += 3 score_TARO 3 break; case B_BIG: B_BIG case B_BIG: score_HANAKO += 3 score_HANAKO 3 break; System.out.printf("%d %d\n", score_TARO,score_HANAKO) System.out.printf System.out System System.out "%d %d\n" score_TARO score_HANAKO String[] args args //A基準で比較する関数
	public static Type compString(String A,String B){
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	} compString {
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	} int a_index = 0 a_index 0 b_index = 0; b_index 0 while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		} a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index) a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index) a_index < A.length() a_index A.length() A.length A b_index < B.length() b_index B.length() B.length B A.charAt(a_index) == B.charAt(b_index) A.charAt(a_index) A.charAt A a_index B.charAt(b_index) B.charAt B b_index {
			a_index++;
			b_index++;
		} a_index++ a_index b_index++ b_index if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		} a_index < A.length() && b_index < B.length() a_index < A.length() a_index A.length() A.length A b_index < B.length() b_index B.length() B.length B {
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		} if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			} A.charAt(a_index) > B.charAt(b_index) A.charAt(a_index) A.charAt A a_index B.charAt(b_index) B.charAt B b_index {
				return Type.A_BIG;
			} return Type.A_BIG; Type.A_BIG Type Type.A_BIG {
				return Type.B_BIG;
			} return Type.B_BIG; Type.B_BIG Type Type.B_BIG if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		} a_index < A.length() && b_index == B.length() a_index < A.length() a_index A.length() A.length A b_index == B.length() b_index B.length() B.length B {
			return Type.A_BIG;
		} return Type.A_BIG; Type.A_BIG Type Type.A_BIG if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		} a_index == A.length() && b_index < B.length() a_index == A.length() a_index A.length() A.length A b_index < B.length() b_index B.length() B.length B {
			return Type.B_BIG;
		} return Type.B_BIG; Type.B_BIG Type Type.B_BIG {
			return Type.SAME;
		} return Type.SAME; Type.SAME Type Type.SAME String A A String B B public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	}

	//A基準で比較する関数
	public static Type compString(String A,String B){
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	}
} public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	}

	//A基準で比較する関数
	public static Type compString(String A,String B){
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	}
} Main
import java.util.Scanner;

enum Type{
	SAME,
	A_BIG,
	B_BIG
};

public class Main {

	public static final int BIG_NUM  = 2000000000;
	public static final int MOD  = 1000000007;

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int N = scanner.nextInt();
		String TARO,HANAKO;
		int score_TARO = 0,score_HANAKO = 0;

		for(int loop = 0; loop < N; loop++){

			TARO = scanner.next();
			HANAKO = scanner.next();

			switch(compString(TARO,HANAKO)){
			case SAME:
				score_TARO += 1;
				score_HANAKO += 1;
				break;
			case A_BIG:
				score_TARO += 3;
				break;
			case B_BIG:
				score_HANAKO += 3;
				break;
			}
		}

		System.out.printf("%d %d\n", score_TARO,score_HANAKO);
	}

	//A基準で比較する関数
	public static Type compString(String A,String B){
		int a_index = 0,b_index = 0;

		while(a_index < A.length() && b_index < B.length() && A.charAt(a_index) == B.charAt(b_index)){
			a_index++;
			b_index++;
		}

		if(a_index < A.length() && b_index < B.length()){
			if(A.charAt(a_index) > B.charAt(b_index)){
				return Type.A_BIG;
			}else{
				return Type.B_BIG;
			}

		}else if(a_index < A.length() && b_index == B.length()){
			return Type.A_BIG;
		}else if(a_index == A.length() && b_index < B.length()){
			return Type.B_BIG;
		}else{
			return Type.SAME;
		}
	}
}
