import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int count_t = 0; count_t 0 int count_h = 0; count_h 0 for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		} {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		} String str_t = scan.next(); str_t scan.next() scan.next scan String str_h = scan.next(); str_h scan.next() scan.next scan if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			} str_t.compareTo(str_h) < 0 str_t.compareTo(str_h) str_t.compareTo str_t str_h 0 {
				count_h += 3;
			} count_h += 3 count_h 3 if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			} str_t.compareTo(str_h) > 0 str_t.compareTo(str_h) str_t.compareTo str_t str_h 0 {
				count_t += 3;
			} count_t += 3 count_t 3 {
				count_h++;
				count_t++;
			} count_h++ count_h count_t++ count_t System.out.println(count_t + " " + count_h) System.out.println System.out System System.out count_t + " " + count_h count_t + " " + count_h count_t " " count_h String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int count_t = 0;
		int count_h = 0;
		
		for(int i = 0; i < n; i++) {
			String str_t = scan.next();
			String str_h = scan.next();
			
			if(str_t.compareTo(str_h) < 0) {
				count_h += 3;
			}else if(str_t.compareTo(str_h) > 0) {
				count_t += 3;
			}else {
				count_h++;
				count_t++;
			}
		}
		
		System.out.println(count_t + " " + count_h);
	}

}

