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