#include <bits/stdc++.h>
using namespace std;
set<int> s;
int main() {
  int n;
  cin >> n;
  int k = 0;
  int max = 0;
  for (int i = 1; i <= 2 * n; i++) {
    int x;
    cin >> x;
    if (s.find(x) == s.end()) {
      k++;
      s.insert(x);
    } else
      k--;
    if (max < k) max = k;
  }
  cout << max;
}
