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