#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, f = 0, d = 0;
  long long s[100002] = {0};
  cin >> n;
  for (long long i = 0; i < 2 * n; i++) {
    cin >> x;
    s[x]++;
    if (s[x] < 2)
      f++;
    else
      f--;
    d = max(d, f);
  }
  cout << d;
  return 0;
}
