#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> s;
  set<int>::iterator it;
  int n;
  cin >> n;
  int x = 2 * n;
  int a[x];
  for (int i = 0; i < x; i++) cin >> a[i];
  int coun = 0;
  for (int i = 0; i < x; i++) {
    it = s.find(a[i]);
    if (it != s.end()) {
      s.erase(it);
    } else {
      s.insert(a[i]);
    }
    int sz = s.size();
    if (sz > coun) {
      coun = sz;
    }
  }
  cout << coun;
  return 0;
}
