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

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int cnt = Integer.parseInt(br.readLine()); cnt Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int taroPoint = 0; taroPoint 0 int hanakoPoint = 0; hanakoPoint 0 for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		} int i = 0; int i = 0; i 0 i < cnt i cnt i++ i++ i {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		} {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		} String line = br.readLine(); line br.readLine() br.readLine br String[] arr = line.split(" "); arr line.split(" ") line.split line " " String taroHand = arr[0]; taroHand arr[0] arr 0 String hanakoHand = arr[1]; hanakoHand arr[1] arr 1 if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			} taroHand.compareTo(hanakoHand) > 0 taroHand.compareTo(hanakoHand) taroHand.compareTo taroHand hanakoHand 0 {
				taroPoint += 3;
			} taroPoint += 3 taroPoint 3 if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			} taroHand.compareTo(hanakoHand) < 0 taroHand.compareTo(hanakoHand) taroHand.compareTo taroHand hanakoHand 0 {
				hanakoPoint += 3;
			} hanakoPoint += 3 hanakoPoint 3 {
				taroPoint++;
				hanakoPoint++;
			} taroPoint++ taroPoint hanakoPoint++ hanakoPoint System.out.println(taroPoint + " " + hanakoPoint) System.out.println System.out System System.out taroPoint + " " + hanakoPoint taroPoint + " " + hanakoPoint taroPoint " " hanakoPoint if (br != null) {
			br.close();
			br = null;
		} br != null br null {
			br.close();
			br = null;
		} br.close() br.close br br = null br null String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int cnt = Integer.parseInt(br.readLine());
		
		int taroPoint = 0;
		int hanakoPoint = 0;
		for (int i = 0; i < cnt; i++) {
			String line = br.readLine();
			String[] arr = line.split(" ");
			String taroHand = arr[0];
			String hanakoHand = arr[1];
			
			if (taroHand.compareTo(hanakoHand) > 0) {
				taroPoint += 3;
			}
			else if (taroHand.compareTo(hanakoHand) < 0) {
				hanakoPoint += 3;
			} else {
				taroPoint++;
				hanakoPoint++;
			}
		}
		System.out.println(taroPoint + " " + hanakoPoint);

		if (br != null) {
			br.close();
			br = null;
		}
	}
}