import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
        int t=0,h=0;
        for(int i=0;i<n;i++){
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        }
		System.out.println(t+" "+h);
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
        int t=0,h=0;
        for(int i=0;i<n;i++){
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        }
		System.out.println(t+" "+h);
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
        int t=0,h=0;
        for(int i=0;i<n;i++){
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        }
		System.out.println(t+" "+h);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
        int t=0,h=0;
        for(int i=0;i<n;i++){
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        }
		System.out.println(t+" "+h);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n=Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int t=0 t 0 h=0; h 0 for(int i=0;i<n;i++){
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        } {
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        } String[] a=br.readLine().split(" "); a br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int s=0; s 0 int l0=a[0].length(); l0 a[0].length() a[0].length a[0] a 0 int l1=a[1].length(); l1 a[1].length() a[1].length a[1] a 1 if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            } l0<l1 l0 l1 {
            	s=l0;
            } s=l0 s l0 {
            	s=l1;
            } s=l1 s l1 boolean even=false; even false for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		} int j=0; int j=0; j 0 j<s j s j++ j++ j {
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		} {
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		} if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			} (int)a[0].charAt(j)>(int)a[1].charAt(j) (int)a[0].charAt(j) a[0].charAt a[0] a 0 j (int)a[1].charAt(j) a[1].charAt a[1] a 1 j {
    				t+=3;
    				even=false;
    				break;
    			} t+=3 t 3 even=false even false break; if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			} (int)a[0].charAt(j)<(int)a[1].charAt(j) (int)a[0].charAt(j) a[0].charAt a[0] a 0 j (int)a[1].charAt(j) a[1].charAt a[1] a 1 j {
    				h+=3;
    				even=false;
    				break;
    			} h+=3 h 3 even=false even false break; {
    				even=true;
    			} even=true even true if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		} even {
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		} if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                } l0>l1 l0 l1 {
                	t+=3;
                } t+=3 t 3 if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                } l0<l1 l0 l1 {
                	h+=3;
                } h+=3 h 3 {
        			t+=1;
        			h+=1;
                } t+=1 t 1 h+=1 h 1 System.out.println(t+" "+h) System.out.println System.out System System.out t+" "+h t+" "+h t " " h String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.parseInt(br.readLine());
        int t=0,h=0;
        for(int i=0;i<n;i++){
            String[] a=br.readLine().split(" ");
            int s=0;
            int l0=a[0].length();
            int l1=a[1].length();
            if(l0<l1){
            	s=l0;
            }else{
            	s=l1;
            }
            boolean even=false;
    		for(int j=0;j<s;j++){
    			if((int)a[0].charAt(j)>(int)a[1].charAt(j)){
    				t+=3;
    				even=false;
    				break;
    			}else if((int)a[0].charAt(j)<(int)a[1].charAt(j)){
    				h+=3;
    				even=false;
    				break;
    			}else{
    				even=true;
    			}
    		}
    		if(even){
                if(l0>l1){
                	t+=3;
                }else if(l0<l1){
                	h+=3;
                }else{
        			t+=1;
        			h+=1;
                }
    		}
        }
		System.out.println(t+" "+h);
	}
}