import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line1); n Integer.parseInt(line1) Integer.parseInt Integer line1 String[] cards = new String[n]; cards new String[n] n for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			cards[i] = sc.nextLine();
		} {
			cards[i] = sc.nextLine();
		} cards[i] = sc.nextLine() cards[i] cards i sc.nextLine() sc.nextLine sc int Tpoint = 0; Tpoint 0 int Hpoint = 0; Hpoint 0 for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		} {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		} String[] kari = cards[i].split(" "); kari cards[i].split(" ") cards[i].split cards[i] cards i " " if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			} kari[0].compareTo(kari[1]) > 0 kari[0].compareTo(kari[1]) kari[0].compareTo kari[0] kari 0 kari[1] kari 1 0 {
				Tpoint += 3;
			} Tpoint += 3 Tpoint 3 if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			} kari[0].compareTo(kari[1]) == 0 kari[0].compareTo(kari[1]) kari[0].compareTo kari[0] kari 0 kari[1] kari 1 0 {
				Tpoint++;
				Hpoint++;
			} Tpoint++ Tpoint Hpoint++ Hpoint if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			} kari[0].compareTo(kari[1]) < 0 kari[0].compareTo(kari[1]) kari[0].compareTo kari[0] kari 0 kari[1] kari 1 0 {
				Hpoint += 3;
			} Hpoint += 3 Hpoint 3 System.out.print(Tpoint) System.out.print System.out System System.out Tpoint System.out.print(" ") System.out.print System.out System System.out " " System.out.println(Hpoint) System.out.println System.out System System.out Hpoint String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		int n = Integer.parseInt(line1);
		String[] cards = new String[n];
		for (int i = 0; i < n; i++) {
			cards[i] = sc.nextLine();
		}
		
		int Tpoint = 0;
		int Hpoint = 0;
		
		for (int i = 0; i < n; i++) {
			String[] kari = cards[i].split(" ");
			if (kari[0].compareTo(kari[1]) > 0) {
				Tpoint += 3;
			} else if (kari[0].compareTo(kari[1]) == 0) {
				Tpoint++;
				Hpoint++;
			} else if (kari[0].compareTo(kari[1]) < 0) {
				Hpoint += 3;
			}
		}
		
		System.out.print(Tpoint);
		System.out.print(" ");
		System.out.println(Hpoint);
	}

}