#include <bits/stdc++.h>
using namespace std;
const int MX = 1e6;
int n, a[MX], b[MX], ma, sum;
int main() {
  cin >> n;
  int a[2 * n];
  for (int i = 0; i < 2 * n; i++) {
    cin >> a[i];
    sum -= b[a[i]];
    b[a[i]]++;
    b[a[i]] %= 2;
    sum += b[a[i]];
    ma = max(sum, ma);
  }
  return cout << ma, 0;
}
