Guest User

Untitled

a guest
Feb 11th, 2019
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.*;
  2. public class Main {
  3.     public static void main(String[] args) {
  4.         Scanner s = new Scanner(System.in);
  5.         short n = Short.parseShort(s.nextLine());
  6.         String [] A = new String[n];
  7.         short c = 0;
  8.         for(short i = 0; i < n; i++) {
  9.             A[i] = s.nextLine();
  10.         }
  11.         for(short i = 0; i < n; i++) {
  12.             String b = s.nextLine();
  13.             if(A[i].equals(b))
  14.                 c++;
  15.         }
  16.         System.out.println(c);
  17.     }
  18. }
Add Comment
Please, Sign In to add comment