#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int Q = 0;
const int MOD = 0;
struct UnionFind {
  int ran, pad, tam;
};
int n, c, d;
bool a[N];
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    int x;
    cin >> x;
    if (a[x]) {
      c--;
    } else {
      a[x] = true;
      c++;
    }
    d = max(d, c);
  }
  cout << d;
  return 0;
}
