#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, A[200001] = {0}, x, no = 0, max = 0;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> x;
    A[x]++;
    if (A[x] == 1) no++;
    if (A[x] == 2) no--;
    if (no > max) max = no;
  }
  cout << max;
}
