
import java.util.*;

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

import java.util.*;

public class Main {
	 
	public static void main(String[] args) {
		Scanner cin=new Scanner(System.in);
		
		int n=cin.nextInt();
		int taro=0,hanako=0;
		
		for(int i=0;i<n;i++) {
			String Ts=cin.next(),Hs=cin.next();
			int j=Ts.compareTo(Hs);
			if(j>0)taro+=3;
			else if(j<0)hanako+=3;
			else {
				taro++;hanako++;
			}
		}
		System.out.println(taro+" "+hanako);
	}
	
	
}
