import java.io.InputStreamReader;
import java.io.LineNumberReader;

/**
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_C
 * 
 * @author eitatsuro
 * 
 */
public class Main {
    
    public static final int WIN_POINTS=3;
    public static final int EVEN_POINTS=1;
    
    public static void main(String[] args) {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    }
    
    public static String shuffle(String original, int h) {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    }
} import java.io.InputStreamReader; InputStreamReader java.io import java.io.LineNumberReader; LineNumberReader java.io public class Main {
    
    public static final int WIN_POINTS=3;
    public static final int EVEN_POINTS=1;
    
    public static void main(String[] args) {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    }
    
    public static String shuffle(String original, int h) {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    }
} Main public static final int WIN_POINTS=3; WIN_POINTS 3 public static final int EVEN_POINTS=1; EVEN_POINTS 1 public static void main(String[] args) {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    } main {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    } try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        } catch (Exception e) {
            System.exit(-1);
        } Exception e {
            System.exit(-1);
        } System.exit(-1) System.exit System -1 1 {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in)); lineNumReader new LineNumberReader(
                    new InputStreamReader(System.in)) String inputStr = null; inputStr null long turnNum = 0; turnNum 0 String taro = null; taro null String hanako = null; hanako null long taroPoint=0; taroPoint 0 long hanakoPoint=0; hanakoPoint 0 while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            } (inputStr = lineNumReader.readLine()) != null (inputStr = lineNumReader.readLine()) inputStr lineNumReader.readLine() lineNumReader.readLine lineNumReader null {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            } if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                } lineNumReader.getLineNumber() == 1 lineNumReader.getLineNumber() lineNumReader.getLineNumber lineNumReader 1 {
                    turnNum = Integer.parseInt(inputStr);
                } turnNum = Integer.parseInt(inputStr) turnNum Integer.parseInt(inputStr) Integer.parseInt Integer inputStr if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                } lineNumReader.getLineNumber() > 1 lineNumReader.getLineNumber() lineNumReader.getLineNumber lineNumReader 1 {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                } String[] line = inputStr.split(" "); line inputStr.split(" ") inputStr.split inputStr " " taro = line[0] taro line[0] line 0 hanako = line[1] hanako line[1] line 1 if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    } taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                        hanakoPoint += WIN_POINTS;
                    } hanakoPoint += WIN_POINTS hanakoPoint WIN_POINTS if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    } taro.compareTo(hanako) == 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } taroPoint += EVEN_POINTS taroPoint EVEN_POINTS hanakoPoint += EVEN_POINTS hanakoPoint EVEN_POINTS {
                        taroPoint += WIN_POINTS;
                    } taroPoint += WIN_POINTS taroPoint WIN_POINTS if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                } lineNumReader.getLineNumber() == turnNum+1 lineNumReader.getLineNumber() lineNumReader.getLineNumber lineNumReader turnNum+1 turnNum 1 {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                } System.out.print(taroPoint) System.out.print System.out System System.out taroPoint System.out.print(" ") System.out.print System.out System System.out " " System.out.println(hanakoPoint) System.out.println System.out System System.out hanakoPoint break; lineNumReader.close() lineNumReader.close lineNumReader String[] args args public static String shuffle(String original, int h) {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    } shuffle {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    } StringBuilder shuffledStr = new StringBuilder(original); shuffledStr new StringBuilder(original) String temp = shuffledStr.substring(0, h); temp shuffledStr.substring(0, h) shuffledStr.substring shuffledStr 0 h shuffledStr.delete(0, h) shuffledStr.delete shuffledStr 0 h shuffledStr.append(temp) shuffledStr.append shuffledStr temp return shuffledStr.toString(); shuffledStr.toString() shuffledStr.toString shuffledStr String original original int h h public class Main {
    
    public static final int WIN_POINTS=3;
    public static final int EVEN_POINTS=1;
    
    public static void main(String[] args) {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    }
    
    public static String shuffle(String original, int h) {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    }
} public class Main {
    
    public static final int WIN_POINTS=3;
    public static final int EVEN_POINTS=1;
    
    public static void main(String[] args) {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    }
    
    public static String shuffle(String original, int h) {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    }
} Main
import java.io.InputStreamReader;
import java.io.LineNumberReader;

/**
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_9_C
 * 
 * @author eitatsuro
 * 
 */
public class Main {
    
    public static final int WIN_POINTS=3;
    public static final int EVEN_POINTS=1;
    
    public static void main(String[] args) {
        try {
            LineNumberReader lineNumReader = new LineNumberReader(
                    new InputStreamReader(System.in));
            
            String inputStr = null;
            long turnNum = 0;
            String taro = null;
            String hanako = null;
            long taroPoint=0;
            long hanakoPoint=0;
            
            while ((inputStr = lineNumReader.readLine()) != null) {
                
                // ????????????????????°?????????.
                if (lineNumReader.getLineNumber() == 1) {
                    turnNum = Integer.parseInt(inputStr);
                }
                
                if (lineNumReader.getLineNumber() > 1) {
                    String[] line = inputStr.split(" ");
                    taro = line[0];
                    hanako = line[1];
                    
                    // ??????
                    if (taro.compareTo(hanako) < 0) {
                        hanakoPoint += WIN_POINTS;
                    } else if (taro.compareTo(hanako) == 0) {
                        taroPoint += EVEN_POINTS;
                        hanakoPoint += EVEN_POINTS;
                    } else {
                        taroPoint += WIN_POINTS;
                    }
                }


                
                if (lineNumReader.getLineNumber() == turnNum+1) {
                    System.out.print(taroPoint);
                    System.out.print(" ");
                    System.out.println(hanakoPoint);
                    break;
                }
            }
            
            lineNumReader.close();
        } catch (Exception e) {
            System.exit(-1);
        }
        
    }
    
    public static String shuffle(String original, int h) {
        StringBuilder shuffledStr = new StringBuilder(original);
        String temp = shuffledStr.substring(0, h);
        shuffledStr.delete(0, h);
        shuffledStr.append(temp);
        return shuffledStr.toString();
        
    }
}