import java.util.*;

public class Main {

	public static void main(String[] args) {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	}
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	}
} Main public static void main(String[] args) {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	} main {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	} String taro taro hanako; hanako int taroP = 0 taroP 0 hanakoP = 0; hanakoP 0 int length; length boolean flag = false; flag false Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		} {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		} taro = sc.next() taro sc.next() sc.next sc hanako = sc.next() hanako sc.next() sc.next sc if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length(); taro.length() < hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako length = taro.length() length taro.length() taro.length taro length = hanako.length() length hanako.length() hanako.length hanako for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			} int j = 0; int j = 0; j 0 j < length j length j++ j++ j {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			} {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			} if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				} taro.charAt(j) > hanako.charAt(j) taro.charAt(j) taro.charAt taro j hanako.charAt(j) hanako.charAt hanako j {
					taroP += 3;
					flag = true;
					break;
				} taroP += 3 taroP 3 flag = true flag true break; if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				} taro.charAt(j) < hanako.charAt(j) taro.charAt(j) taro.charAt taro j hanako.charAt(j) hanako.charAt hanako j {
					hanakoP += 3;
					flag = true;
					break;
				} hanakoP += 3 hanakoP 3 flag = true flag true break; if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			} flag == false flag false {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			} if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3; taro.equals(hanako) taro.equals taro hanako {
					taroP += 1;
					hanakoP += 1;
				} taroP += 1 taroP 1 hanakoP += 1 hanakoP 1 if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3; taro.length() > hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako taroP += 3 taroP 3 hanakoP += 3 hanakoP 3 flag = false flag false System.out.println(taroP + " " + hanakoP) System.out.println System.out System System.out taroP + " " + hanakoP taroP + " " + hanakoP taroP " " hanakoP String[] args args public class Main {

	public static void main(String[] args) {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	}
} public class Main {

	public static void main(String[] args) {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		String taro, hanako;
		int taroP = 0, hanakoP = 0;
		int length;
		boolean flag = false;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			taro = sc.next();
			hanako = sc.next();
			if (taro.length() < hanako.length())
				length = taro.length();
			else
				length = hanako.length();
			for (int j = 0; j < length; j++) {
				if (taro.charAt(j) > hanako.charAt(j)) {
					taroP += 3;
					flag = true;
					break;
				} else if (taro.charAt(j) < hanako.charAt(j)) {
					hanakoP += 3;
					flag = true;
					break;
				}
			}
			if (flag == false) {
				if (taro.equals(hanako)) {
					taroP += 1;
					hanakoP += 1;
				} else if (taro.length() > hanako.length())
					taroP += 3;
				else
					hanakoP += 3;
			}
			flag = false;
		}

		System.out.println(taroP + " " + hanakoP);
	}
}