#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, size_of_vec = 1, s, previous_size = 0;
  cin >> n;
  set<int> v;
  set<int>::iterator it;
  for (int i = 0; i < 2 * n; i++) {
    cin >> s;
    v.erase(s);
    if (previous_size == v.size()) {
      v.insert(s);
    }
    if (v.size() > size_of_vec) {
      size_of_vec = v.size();
    }
    previous_size = v.size();
  }
  cout << size_of_vec << endl;
}
