#include <bits/stdc++.h>
using namespace std;
const int OO = 0x3f3f3f3f, MOD = 1000000007;
const long double PI = 3.14159265359;
int main() {
  int n, x;
  cin >> n;
  bool vis[n + 1];
  memset(vis, 0, sizeof(vis));
  int cnt = 0;
  int mx = 0;
  for (int i = 0; i < 2 * n; i++) {
    cin >> x;
    if (vis[x])
      cnt--;
    else {
      vis[x] = 1;
      cnt++;
      mx = max(mx, cnt);
    }
  }
  cout << mx;
  return 0;
}
