#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int mv = 0, v = 0, x;
  bool c[100005] = {false};
  for (int(i) = 0; (i) < (2 * n); (i)++) {
    cin >> x;
    if (c[x])
      v--;
    else {
      c[x] = true;
      v++;
    }
    if (v > mv) mv = v;
  }
  cout << mv;
  return 0;
}
