#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, m = 0, N, k, l = 0;
  cin >> N;
  n = 2 * N;
  map<int, int> mamak;
  for (int i = 0; i < n; i++) {
    cin >> k;
    mamak[k]++;
    if (mamak[k] == 1) {
      l++;
    } else
      l--;
    m = max(m, l);
  }
  cout << m;
  return 0;
}
