import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int i i j j taro = 0 taro 0 hanako = 0; hanako 0 for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			} i = 0; i = 0 i 0 i < n i n i++ i++ i {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			} {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			} String input[] = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length(); min (input[0].length() < input[1].length()) ? input[0].length() : input[1].length() (input[0].length() < input[1].length()) input[0].length() input[0].length input[0] input 0 input[1].length() input[1].length input[1] input 1 input[0].length() input[0].length input[0] input 0 input[1].length() input[1].length input[1] input 1 for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				} j = 0; j = 0 j 0 j < min j min j++ j++ j {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				} {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				} if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					} input[0].charAt(j) > input[1].charAt(j) input[0].charAt(j) input[0].charAt input[0] input 0 j input[1].charAt(j) input[1].charAt input[1] input 1 j {
						taro = taro + 3;
						break;
					} taro = taro + 3 taro taro + 3 taro 3 break; if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					} input[0].charAt(j) < input[1].charAt(j) input[0].charAt(j) input[0].charAt input[0] input 0 j input[1].charAt(j) input[1].charAt input[1] input 1 j {
						hanako = hanako + 3;
						break;
					} hanako = hanako + 3 hanako hanako + 3 hanako 3 break; if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					} j == min - 1 j min - 1 min 1 {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					} if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						} input[0].length() > input[1].length() input[0].length() input[0].length input[0] input 0 input[1].length() input[1].length input[1] input 1 {
							taro = taro + 3;
						} taro = taro + 3 taro taro + 3 taro 3 if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						} input[0].length() < input[1].length() input[0].length() input[0].length input[0] input 0 input[1].length() input[1].length input[1] input 1 {
							hanako = hanako + 3;
						} hanako = hanako + 3 hanako hanako + 3 hanako 3 {
							taro = taro + 1;
							hanako = hanako + 1;
						} taro = taro + 1 taro taro + 1 taro 1 hanako = hanako + 1 hanako hanako + 1 hanako 1 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			int n = Integer.parseInt(br.readLine());
			int i, j, taro = 0, hanako = 0;
			for (i = 0; i < n; i++) {
				String input[] = br.readLine().split(" ");
				int min = (input[0].length() < input[1].length()) ? input[0].length() : input[1].length();
				for (j = 0; j < min; j++) {
					if (input[0].charAt(j) > input[1].charAt(j)) {
						taro = taro + 3;
						break;
					} else if (input[0].charAt(j) < input[1].charAt(j)) {
						hanako = hanako + 3;
						break;
					} else if (j == min - 1) {
						if (input[0].length() > input[1].length()) {
							taro = taro + 3;
						} else if (input[0].length() < input[1].length()) {
							hanako = hanako + 3;
						} else {
							taro = taro + 1;
							hanako = hanako + 1;
						}
					}
				}
			}
			System.out.println(taro + " " + hanako);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}