#include <bits/stdc++.h>
using namespace std;
int s = 0, b[1000001];
int main() {
  int n, cnt = 0, a;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> a;
    if (b[a] == 0) {
      s++;
    } else {
      s--;
    }
    cnt = max(cnt, s);
    b[a] = 1;
  }
  cout << cnt << endl;
  return 0;
}
