#include <bits/stdc++.h>
using namespace std;
int n, i, a, q, p, b[100001];
int main() {
  cin >> n;
  for (i = 1; i <= 2 * n; i++) {
    cin >> a;
    b[a]++;
    if (b[a] == 1) p++;
    if (b[a] == 2) p--;
    if (q < p) q = p;
  }
  cout << q;
}
