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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) short point1 = 0 point1 0 point2 = 0 point2 0 n = Short.parseShort(in.readLine()); n Short.parseShort(in.readLine()) Short.parseShort Short in.readLine() in.readLine in for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		} {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		} String[] card = in.readLine().split(" "); card in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			} card[0].compareTo(card[1]) > 0 card[0].compareTo(card[1]) card[0].compareTo card[0] card 0 card[1] card 1 0 {
				point1 += 3;
			} point1 += 3 point1 3 if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			} card[0].compareTo(card[1]) < 0 card[0].compareTo(card[1]) card[0].compareTo card[0] card 0 card[1] card 1 0 {
				point2 += 3;
			} point2 += 3 point2 3 if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			} card[0].compareTo(card[1]) == 0 card[0].compareTo(card[1]) card[0].compareTo card[0] card 0 card[1] card 1 0 {
				point1++;
				point2++;
			} point1++ point1 point2++ point2 System.out.println(point1 + " " + point2) System.out.println System.out System System.out point1 + " " + point2 point1 + " " + point2 point1 " " point2 String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		short point1 = 0, point2 = 0, n = Short.parseShort(in.readLine());
		for (int i = 0; i < n; i++) {
			String[] card = in.readLine().split(" ");
			if (card[0].compareTo(card[1]) > 0) {
				point1 += 3;
			} else if (card[0].compareTo(card[1]) < 0) {
				point2 += 3;
			} else if (card[0].compareTo(card[1]) == 0) {
				point1++;
				point2++;
			}
		}
		System.out.println(point1 + " " + point2);
	}
}