#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, l = 0, b, m = 0;
  cin >> n;
  int a[100002] = {0};
  for (i = 0; i < 2 * n; i++) {
    cin >> b;
    a[b] = a[b] + 1;
    if (a[b] == 1)
      l++;
    else if (a[b] == 2)
      l--;
    if (l > m) m = l;
  }
  cout << m;
}
