#include <bits/stdc++.h>
using namespace std;
int main() {
  set<int> st;
  int n, index, count = 0;
  cin >> n;
  st.clear();
  for (int x = 0; x < 2 * n; x++) {
    cin >> index;
    if (st.find(index) == st.end())
      st.insert(index);
    else
      st.erase(index);
    if (st.size() > count) count = st.size();
  }
  cout << count << endl;
  return 0;
}
