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