import java.util.Scanner;


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


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