#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  set<int> a;
  int res = 0;
  for (int i = 0; i < 2 * n; ++i) {
    int x;
    cin >> x;
    if (a.count(x))
      a.erase(x);
    else
      a.insert(x);
    res = max<int64_t>(res, a.size());
  }
  cout << res << endl;
  return 0;
}
