#include <bits/stdc++.h>
int ar[100000];
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0, ans = 0;
  int r;
  for (int i = 0; i < 2 * n; i++) {
    cin >> r;
    if (ar[r]) {
      ar[r] = 0;
      c--;
    } else {
      c++;
      ar[r] = 1;
    }
    if (ans < c) ans = c;
  }
  cout << ans << endl;
}
