#include <bits/stdc++.h>
using namespace std;
const int N = int(1e5) + 7;
int A[2 * N];
bool Was[N];
int main() {
  int n;
  cin >> n;
  int am = 0;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    Was[i] = false;
  }
  for (int i = 0; i < 2 * n; ++i) {
    cin >> A[i];
    if (Was[A[i]]) {
      am--;
      Was[A[i]] = false;
    } else {
      Was[A[i]] = true;
      am++;
    }
    ans = max(ans, am);
  }
  cout << ans;
  return 0;
}
