#include <bits/stdc++.h>
using namespace std;
const int maxn = 200007;
const int inf = 1000000007;
int n;
int a[maxn];
int an = -inf;
set<int> s;
int main() {
  cin >> n;
  n <<= 1;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    if (s.count(a[i])) {
      s.erase(a[i]);
    } else
      s.insert(a[i]);
    an = max(an, (int)s.size());
  }
  return !(cout << an);
}
