#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, tot = 0, m = 0;
  bitset<100000> vis;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    int a;
    cin >> a;
    if (vis[a]) {
      tot--;
      continue;
    }
    vis[a] = true;
    tot++;
    m = max(tot, m);
  }
  cout << m << "\n";
}
