#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, temp, count = 0, max_val = 0;
  scanf("%d", &n);
  bool a[n];
  for (i = 0; i < n; i++) a[i] = false;
  for (i = 0; i < 2 * n; i++) {
    scanf("%d", &temp);
    temp--;
    if (a[temp] == false) {
      count++;
      a[temp] = true;
    } else {
      count--;
    }
    if (count > max_val) max_val = count;
  }
  cout << max_val;
  return 0;
}
