#include <bits/stdc++.h>
using namespace std;
long long p[100000], MX = -1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, ans = 0;
  cin >> n;
  long long x[2 * n + 10000];
  for (long long i = 0; i < 2 * n; ++i) cin >> x[i];
  for (long long i = 0; i < 2 * n; ++i) {
    if (p[x[i]] == 0)
      ++ans;
    else
      --ans;
    MX = max(ans, MX);
    p[x[i]] = 69;
  }
  cout << MX;
}
