#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  set<long long> a;
  long long mx = 1;
  for (long long i = 1; i <= 2 * n; ++i) {
    long long t;
    cin >> t;
    if (a.find(t) != a.end()) {
      a.erase(t);
    } else {
      a.insert(t);
      mx = max(mx, (long long)a.size());
    }
  }
  cout << mx;
}
