import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	}
} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	} main {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int taro = 0; taro 0 int hanako = 0; hanako 0 int n = Integer.parseInt(s.next()); n Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		} {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		} int c = s.next().compareTo(s.next()); c s.next().compareTo(s.next()) s.next().compareTo s.next() s.next s s.next() s.next s if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			} c > 0 c 0 {
				taro += 3;
			} taro += 3 taro 3 if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			} c == 0 c 0 {
				taro++;
				hanako++;
			} taro++ taro hanako++ hanako {
				hanako += 3;
			} hanako += 3 hanako 3 System.out.printf("%d %d\n", taro, hanako) System.out.printf System.out System System.out "%d %d\n" taro hanako String[] args args public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int taro = 0;
		int hanako = 0;
		int n = Integer.parseInt(s.next());
		for (int i = 0; i < n; ++i) {
			int c = s.next().compareTo(s.next());
			if (c > 0) {
				taro += 3;
			} else if (c == 0) {
				taro++;
				hanako++;
			} else {
				hanako += 3;
			}
		}
		System.out.printf("%d %d\n", taro, hanako);
	}
}