
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	} main {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int count = scn.nextInt(); count scn.nextInt() scn.nextInt scn int taroScore = 0; taroScore 0 int hanakoScore = 0; hanakoScore 0 for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		} int i = 0; int i = 0; i 0 i < count i count i++ i++ i {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		} {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		} String taroData = scn.next(); taroData scn.next() scn.next scn String hanakoData = scn.next(); hanakoData scn.next() scn.next scn int result = taroData.compareTo(hanakoData); result taroData.compareTo(hanakoData) taroData.compareTo taroData hanakoData if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			} result > 0 result 0 {
				taroScore = taroScore + 3;
			} taroScore = taroScore + 3 taroScore taroScore + 3 taroScore 3 if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			} result < 0 result 0 {
				hanakoScore = hanakoScore + 3;
			} hanakoScore = hanakoScore + 3 hanakoScore hanakoScore + 3 hanakoScore 3 if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			} result == 0 result 0 {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			} taroScore = taroScore + 1 taroScore taroScore + 1 taroScore 1 hanakoScore = hanakoScore + 1 hanakoScore hanakoScore + 1 hanakoScore 1 System.out.println(taroScore + " " + hanakoScore) System.out.println System.out System System.out taroScore + " " + hanakoScore taroScore + " " + hanakoScore taroScore " " hanakoScore String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = scn.nextInt();
		int taroScore = 0;
		int hanakoScore = 0;
		for (int i = 0; i < count; i++) {
			String taroData = scn.next();
			String hanakoData = scn.next();
			int result = taroData.compareTo(hanakoData);
			if (result > 0) {
				taroScore = taroScore + 3;
			} else if (result < 0) {
				hanakoScore = hanakoScore + 3;
			} else if (result == 0) {
				taroScore = taroScore + 1;
				hanakoScore = hanakoScore + 1;
			}
		}
		System.out.println(taroScore + " " + hanakoScore);
	}
}

