import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int taro=0; taro 0 int hanako=0; hanako 0 String first = ""; first "" String second = ""; second "" for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		} {
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		} first = scan.next() first scan.next() scan.next scan second = scan.next() second scan.next() scan.next scan if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			} (first.compareTo(second))>0 (first.compareTo(second)) first.compareTo first second 0 taro+=3 taro 3 if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			} (first.compareTo(second))<0 (first.compareTo(second)) first.compareTo first second 0 hanako+=3 hanako 3 {
				taro++;
				hanako++;
			} taro++ taro hanako++ hanako 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{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int taro=0;
		int hanako=0;
		String first = "";
		String second = "";
		for(int i=0;i<n;i++){
			first = scan.next();
			second = scan.next();
			if((first.compareTo(second))>0)
				taro+=3;
			else if((first.compareTo(second))<0)
				hanako+=3;
			else{
				taro++;
				hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	}
}