import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		}

	} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		}

	} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc String [] str1=new String[n]; str1 new String[n] n String [] str2=new String[n]; str2 new String[n] n int tarou=0; tarou 0 int hanako=0; hanako 0 for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			str1[i]=sc.next();
			str2[i]=sc.next();
		} {
			str1[i]=sc.next();
			str2[i]=sc.next();
		} str1[i]=sc.next() str1[i] str1 i sc.next() sc.next sc str2[i]=sc.next() str2[i] str2 i sc.next() sc.next sc for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		} int j=0; int j=0; j 0 j<n j n j++ j++ j {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		} {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		} char [] ch1=str1[j].toCharArray(); ch1 str1[j].toCharArray() str1[j].toCharArray str1[j] str1 j char [] ch2=str2[j].toCharArray(); ch2 str2[j].toCharArray() str2[j].toCharArray str2[j] str2 j if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			} str1[j].length()<=str2[j].length() str1[j].length() str1[j].length str1[j] str1 j str2[j].length() str2[j].length str2[j] str2 j {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			} char [] ch3=new char[str2[j].length()]; ch3 new char[str2[j].length()] str2[j].length() str2[j].length str2[j] str2 j ch3=str1[j].toCharArray() ch3 str1[j].toCharArray() str1[j].toCharArray str1[j] str1 j for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				} int k=0; int k=0; k 0 k<str1[j].length() k str1[j].length() str1[j].length str1[j] str1 j k++ k++ k {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				} {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				} if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					} str1[j].length()==str2[j].length() str1[j].length() str1[j].length str1[j] str1 j str2[j].length() str2[j].length str2[j] str2 j {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					} if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} k+1==str1[j].length()&&ch3[k]==ch2[k] k+1==str1[j].length() k+1 k 1 str1[j].length() str1[j].length str1[j] str1 j ch3[k]==ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							tarou+=1;
							hanako+=1;
						} tarou+=1 tarou 1 hanako+=1 hanako 1 if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} ch3[k]==ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							continue;
						} continue; if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} ch3[k]>ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							tarou+=3;
							break;
						} tarou+=3 tarou 3 break; if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} ch3[k]<ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							hanako+=3;
							break;
						} hanako+=3 hanako 3 break; {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					} if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} k+1==str1[j].length()&&ch3[k]==ch2[k] k+1==str1[j].length() k+1 k 1 str1[j].length() str1[j].length str1[j] str1 j ch3[k]==ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							hanako+=3;
						} hanako+=3 hanako 3 if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} ch3[k]==ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							continue;
						} continue; if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} ch3[k]>ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							tarou+=3;
							break;
						} tarou+=3 tarou 3 break; if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						} ch3[k]<ch2[k] ch3[k] ch3 k ch2[k] ch2 k {
							hanako+=3;
							break;
						} hanako+=3 hanako 3 break; if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			} str1[j].length()>str2[j].length() str1[j].length() str1[j].length str1[j] str1 j str2[j].length() str2[j].length str2[j] str2 j {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			} char [] ch3=new char [str1[j].length()]; ch3 new char [str1[j].length()] str1[j].length() str1[j].length str1[j] str1 j ch3=str2[j].toCharArray() ch3 str2[j].toCharArray() str2[j].toCharArray str2[j] str2 j for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				} int k=0; int k=0; k 0 k<str2[j].length() k str2[j].length() str2[j].length str2[j] str2 j k++ k++ k {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				} {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				} if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						} k+1==str2[j].length()&&ch3[k]==ch1[k] k+1==str2[j].length() k+1 k 1 str2[j].length() str2[j].length str2[j] str2 j ch3[k]==ch1[k] ch3[k] ch3 k ch1[k] ch1 k {
							tarou+=3;
						} tarou+=3 tarou 3 if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						} ch3[k]==ch1[k] ch3[k] ch3 k ch1[k] ch1 k {
							continue;
						} continue; if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						} ch3[k]>ch1[k] ch3[k] ch3 k ch1[k] ch1 k {
							hanako+=3;
							break;
						} hanako+=3 hanako 3 break; if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						} ch3[k]<ch1[k] ch3[k] ch3 k ch1[k] ch1 k {
							tarou+=3;
							break;
						} tarou+=3 tarou 3 break; System.out.println(tarou+" "+hanako) System.out.println System.out System System.out tarou+" "+hanako tarou+" "+hanako tarou " " hanako sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		}

	} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		}

	} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String [] str1=new String[n];
		String [] str2=new String[n];
		int tarou=0;
		int hanako=0;
		for(int i=0;i<n;i++) {
			str1[i]=sc.next();
			str2[i]=sc.next();
		}
		for(int j=0;j<n;j++) {
			char [] ch1=str1[j].toCharArray();
			char [] ch2=str2[j].toCharArray();
			if(str1[j].length()<=str2[j].length()) {
				char [] ch3=new char[str2[j].length()];
				ch3=str1[j].toCharArray();
				for(int k=0;k<str1[j].length();k++) {
					if(str1[j].length()==str2[j].length()) {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							tarou+=1;
							hanako+=1;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
					else {
						if(k+1==str1[j].length()&&ch3[k]==ch2[k]) {
							hanako+=3;
						}
						else if(ch3[k]==ch2[k]) {
							continue;
						}
						else if(ch3[k]>ch2[k]) {
							tarou+=3;
							break;
						}
						else if(ch3[k]<ch2[k]) {
							hanako+=3;
							break;
						}
					}
				}
			}
			else if(str1[j].length()>str2[j].length()) {
				char [] ch3=new char [str1[j].length()];
				ch3=str2[j].toCharArray();
				for(int k=0;k<str2[j].length();k++) {
						if(k+1==str2[j].length()&&ch3[k]==ch1[k]) {
							tarou+=3;
						}
						else if(ch3[k]==ch1[k]) {
							continue;
						}
						else if(ch3[k]>ch1[k]) {
							hanako+=3;
							break;
						}
						else if(ch3[k]<ch1[k]) {
							tarou+=3;
							break;
						}
				}
			}
		}
			System.out.println(tarou+" "+hanako);
		sc.close();
		}

	}
