import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	}
} Main public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	} main {
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	} Scanner scan = null; scan null try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		} {
			if(scan!=null)scan.close();
		} if(scan!=null)scan.close(); scan!=null scan null scan.close() scan.close scan {
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		} scan = new Scanner(System.in) scan new Scanner(System.in) int hanako = 0; hanako 0 int tarou = 0; tarou 0 int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			} {
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			} String a = scan.next(); a scan.next() scan.next scan String b = scan.next(); b scan.next() scan.next scan int check = a.compareTo(b); check a.compareTo(b) a.compareTo a b if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				} check <0 check 0 {
					hanako += 3;
				} hanako += 3 hanako 3 if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				} check > 0 check 0 {
					tarou += 3;
				} tarou += 3 tarou 3 {
					hanako++;
					tarou++;
				} hanako++ hanako tarou++ tarou System.out.println(tarou +" "+hanako) System.out.println System.out System System.out tarou +" "+hanako tarou +" "+hanako tarou " " hanako String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int hanako = 0;
			int tarou = 0;
			int n = scan.nextInt();
			for(int i = 0; i < n;i++){
				String a = scan.next();
				String b = scan.next();
				int check = a.compareTo(b);
				if(check <0){
					hanako += 3;
				}else if(check > 0){
					tarou += 3;
				}else{
					hanako++;
					tarou++;
				}
			}
			System.out.println(tarou +" "+hanako);
		}finally{
			if(scan!=null)scan.close();
		}
	}
}