#include <bits/stdc++.h>
using namespace std;
bool flag[101512];
int main(void) {
  int n, tmp, ans = 0, cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n + n; i++) {
    scanf("%d", &tmp);
    if (flag[tmp])
      cnt--;
    else {
      flag[tmp] = 1;
      cnt++;
      ans = max(ans, cnt);
    }
  }
  printf("%d", ans);
  return 0;
}
