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