Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- short n = Short.parseShort(s.nextLine());
- String [] A = new String[n];
- short c = 0;
- for(short i = 0; i < n; i++) {
- A[i] = s.nextLine();
- }
- for(short i = 0; i < n; i++) {
- String b = s.nextLine();
- if(A[i].equals(b))
- c++;
- }
- System.out.println(c);
- }
- }
Add Comment
Please, Sign In to add comment