import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	}
} import java.util.*; util.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	} main {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		} {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		} String t = sc.next(); t sc.next() sc.next sc String h = sc.next(); h sc.next() sc.next sc if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;} t.compareTo(h) < 0 t.compareTo(h) t.compareTo t h 0 {hanako += 3;} hanako += 3 hanako 3 if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;} t.compareTo(h) > 0 t.compareTo(h) t.compareTo t h 0 {taro += 3;} taro += 3 taro 3 {hanako++; taro++;} hanako++ hanako taro++ taro System.out.println(taro+" "+hanako) System.out.println System.out System System.out taro+" "+hanako taro+" "+hanako taro " " hanako String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	}
} public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	}
} Main
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		int taro = 0;
		int hanako = 0;
		for (int i=0; i<n; i++) {
			String t = sc.next();
			String h = sc.next();
			if (t.compareTo(h) < 0) {hanako += 3;}
			else if (t.compareTo(h) > 0) {taro += 3;}
			else {hanako++; taro++;}
		}
		System.out.println(taro+" "+hanako);
	}
}
