text: /* ========================================
   * Points/Time : 249.72
   * Total/ETA : 250
   * Status : AC !!
   ==========================================*/
  
  #include <bits/stdc++.h>
  using namespace std;
  
  #define REP(i,n) for(int i=0;i<(n);i++)
  #define FOR(i,a,b) for(int i=(a);i<=(b);i++)
  #define FORD(i,a,b) for(int i=(a);i>=(b);i--)
  #define ALL(A)     (A).begin(), (A).end()
  #define REVALL(A)     (A).rbegin(), (A).rend()
  #define F first
  #define S second
  #define PB push_back
  #define MP make_pair
  #define MINUPDATE(A,B) A = min((A), (B));
  #define MAXUPDATE(A,B) A = max((A), (B));
  #define SGN(X) ((X) ? ( (X)>0?1:-1 ) : 0)
  #define SETCONTAINS(S,E) ((S).find(E) != (S).end())
  
  #define MSG(a) cerr << "> " << #a << ": " << (a) << endl;
  template<typename T>
  void print_vector(const vector<T> & vec, const string & name) {
    cerr << name << ": ";
    for (const auto & x: vec) cerr << x << "  ";
    cerr << endl;
  }
  
  const int CLEAN = -1;
  const int UNDEF = -42;
  const long long MOD = 1000000007;
  
  // direction vectors - 4 directions
  const vector<int> DX4 = { 0, 0, -1, 1};
  const vector<int> DY4 = {-1, 1,  0, 0};
  const vector<pair<int,int>> DXY4 = { {0,-1}, {0,1}, {-1,0}, {1,0} };
  // direction vectors - 8 directions
  const vector<int> DX8 = {-1, -1, -1,   0, 0,   1,  1,  1};
  const vector<int> DY8 = {-1,  0,  1,  -1, 1,  -1,  0,  1};
  const vector<pair<int,int>> DXY8 = {
    {-1,-1}, {-1,0}, {-1,1},
    { 0,-1},         { 0,1},
    { 1,-1}, { 1,0}, { 1,1}
  };
  
  
  class CoolPairsEasy {
  public:
    int count(vector <string> firstname, vector <string> lastname) {
      int result=0;
      for (int i = 0; i < firstname.size(); i += 1) {
        for (int j = 0; j < firstname.size(); j += 1) {
          result+=(i!=j && firstname[i]==lastname[j]);
        }
      }
      return result;
    }
  };
  