import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws IOException {

		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int x = Integer.parseInt(br.readLine());
		int t = 0, h = 0;
		for (int i = 0; i < x; i++) {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		}

		System.out.printf("%d %d%n", t, h);

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.FileReader; FileReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) throws IOException {

		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int x = Integer.parseInt(br.readLine());
		int t = 0, h = 0;
		for (int i = 0; i < x; i++) {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		}

		System.out.printf("%d %d%n", t, h);

	}

} Main public static void main(String[] args) throws IOException {

		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int x = Integer.parseInt(br.readLine());
		int t = 0, h = 0;
		for (int i = 0; i < x; i++) {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		}

		System.out.printf("%d %d%n", t, h);

	} main {

		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int x = Integer.parseInt(br.readLine());
		int t = 0, h = 0;
		for (int i = 0; i < x; i++) {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		}

		System.out.printf("%d %d%n", t, h);

	} BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in)); br new BufferedReader(new
		 InputStreamReader(System.in)) int x = Integer.parseInt(br.readLine()); x Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int t = 0 t 0 h = 0; h 0 for (int i = 0; i < x; i++) {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		} int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		} {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		} String str = br.readLine(); str br.readLine() br.readLine br String[] fight = str.split(" "); fight str.split(" ") str.split str " " if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			} fight[0].equals(fight[1]) fight[0].equals fight[0] fight 0 fight[1] fight 1 {
				t++;
				h++;
			} t++ t h++ h {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			} boolean bl=false; bl false for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				} int l = 0; int l = 0; l 0 (l<fight[0].length())&&(l<fight[1].length()) (l<fight[0].length()) l fight[0].length() fight[0].length fight[0] fight 0 (l<fight[1].length()) l fight[1].length() fight[1].length fight[1] fight 1 l++ l++ l {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				} {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				} if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					} fight[0].charAt(l) == fight[1].charAt(l) fight[0].charAt(l) fight[0].charAt fight[0] fight 0 l fight[1].charAt(l) fight[1].charAt fight[1] fight 1 l continue; if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					} fight[0].charAt(l) > fight[1].charAt(l) fight[0].charAt(l) fight[0].charAt fight[0] fight 0 l fight[1].charAt(l) fight[1].charAt fight[1] fight 1 l {
						t += 3;bl=true;
						break;
					} t += 3 t 3 bl=true bl true break; if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					} fight[0].charAt(l) < fight[1].charAt(l) fight[0].charAt(l) fight[0].charAt fight[0] fight 0 l fight[1].charAt(l) fight[1].charAt fight[1] fight 1 l {
						h += 3;bl=true;
						break;
					} h += 3 h 3 bl=true bl true break; if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				} bl==false bl false {
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				} if(fight[0].length()>fight[1].length())t+=3;
					else h+=3; fight[0].length()>fight[1].length() fight[0].length() fight[0].length fight[0] fight 0 fight[1].length() fight[1].length fight[1] fight 1 t+=3 t 3 h+=3 h 3 System.out.printf("%d %d%n", t, h) System.out.printf System.out System System.out "%d %d%n" t h String[] args args
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

class Main {
	public static void main(String[] args) throws IOException {

		 BufferedReader br = new BufferedReader(new
		 InputStreamReader(System.in));
		//BufferedReader br = new BufferedReader(new FileReader("sample.txt"));
		int x = Integer.parseInt(br.readLine());
		int t = 0, h = 0;
		for (int i = 0; i < x; i++) {
			//System.out.println(i+":"+t+" " +h);
			String str = br.readLine();
			String[] fight = str.split(" ");
			if (fight[0].equals(fight[1])) {
				t++;
				h++;
			} else {
				boolean bl=false;
				for (int l = 0;(l<fight[0].length())&&(l<fight[1].length()); l++) {

					if (fight[0].charAt(l) == fight[1].charAt(l))
						continue;
					else if (fight[0].charAt(l) > fight[1].charAt(l)) {
						t += 3;bl=true;
						break;
					} else if(fight[0].charAt(l) < fight[1].charAt(l)){
						h += 3;bl=true;
						break;
					}
				}if(bl==false){
					if(fight[0].length()>fight[1].length())t+=3;
					else h+=3;
				}

			}
		}

		System.out.printf("%d %d%n", t, h);

	}

}