import java.util.*;
 
public class Main {
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	}
	
} import java.util.*; util.* java public class Main {
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	}
	
} Main public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	} main {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	} Scanner scan = new Scanner( System.in ); scan new Scanner( System.in ) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int TPoint = 0; TPoint 0 int HPoint = 0; HPoint 0 for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		} {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		} String T = scan.next(); T scan.next() scan.next scan String H = scan.next(); H scan.next() scan.next scan int result = T.compareToIgnoreCase(H); result T.compareToIgnoreCase(H) T.compareToIgnoreCase T H if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			} result > 0 result 0 {
				TPoint += 3;
								
			} TPoint += 3 TPoint 3 if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			} result == 0 result 0 {
				TPoint += 1;
				HPoint += 1;
				
			} TPoint += 1 TPoint 1 HPoint += 1 HPoint 1 if ( result < 0 ) {
				HPoint += 3;
				
			} result < 0 result 0 {
				HPoint += 3;
				
			} HPoint += 3 HPoint 3 System.out.println( TPoint + " " + HPoint ) System.out.println System.out System System.out TPoint + " " + HPoint TPoint + " " + HPoint TPoint " " HPoint String args[] args public class Main {
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	}
	
} public class Main {
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	}
	
} Main
import java.util.*;
 
public class Main {
    public static void main( String args[] ) {
        Scanner scan = new Scanner( System.in );
		
		int n = scan.nextInt();
		
		int TPoint = 0;
		int HPoint = 0;
		for ( int i = 0; i < n; i++ ) {
			String T = scan.next();
			String H = scan.next();
			
			int result = T.compareToIgnoreCase(H);
			if ( result > 0 ) {
				TPoint += 3;
								
			} else if ( result == 0) {
				TPoint += 1;
				HPoint += 1;
				
			} else if ( result < 0 ) {
				HPoint += 3;
				
			}
			
		}
		System.out.println( TPoint + " " + HPoint );
		
	}
	
}