#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int f[N];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int ans = 0;
  int cur = 0;
  for (int i = 0; i < 2 * n; i++) {
    int x;
    cin >> x;
    if (f[x] == 0) {
      cur++;
      f[x] = 1;
    } else {
      cur--;
      f[x] = 2;
    }
    ans = max(ans, cur);
  }
  cout << ans << endl;
  return 0;
}
