#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, k, n, m, x, y, z, cnt, ans, tt, mx;
vector<int> v, q, t;
string s, g, r;
int main() {
  cin >> n;
  map<int, int> mp;
  for (long long i = 0; i < n * 2; i++) {
    cin >> x;
    if (mp[x] == 0) {
      cnt++;
      mx = max(mx, cnt);
    } else {
      cnt--;
    }
    mp[x]++;
  }
  cout << mx;
}
