#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, x, y, z;
  int N;
  cin >> N;
  unordered_set<int> hs;
  int ans = 0;
  for ((i) = (0); (i) < (2 * N); (i) += (1)) {
    cin >> x;
    if (hs.find(x) != hs.end())
      hs.erase(x);
    else
      hs.insert(x);
    ans = max(ans, (int)hs.size());
  }
  cout << ans << "\n";
  return 0;
}
