#include <bits/stdc++.h>
using namespace std;
char a[100005];
int main() {
  int n;
  while (cin >> n) {
    memset(a, '0', sizeof(a));
    int i;
    int max = 0, count = 0;
    int k = 0;
    n *= 2;
    for (i = 1; i <= n; i++) {
      cin >> k;
      if (a[k] == '0') {
        a[k] = '1';
        count++;
        max = count > max ? count : max;
      } else {
        a[k] = '0';
        count--;
      }
    }
    cout << max << endl;
  }
  return 0;
}
