#include <bits/stdc++.h>
using namespace std;
const long long llmax = 9223372036854775807;
const long long llmin = -9223372036854775808;
const int intmin = -2147483648;
const int intmax = 2147483647;
const int mod = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (a == 0 || b == 0)
    return a + b;
  else
    return gcd(b, a % b);
}
template <typename A, typename B>
inline A fexp(A x, B p) {
  A ans = 1;
  for (; p; p >>= 1, x = 1LL * x * x % mod)
    if (p & 1) ans = 1LL * ans * x % mod;
  return ans;
}
template <typename T>
inline void read(T& x) {
  x = 0;
  T f = 1;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -1;
  } while (ch < '0' || ch > '9');
  do x = x * 10 + ch - '0', ch = getchar();
  while (ch <= '9' && ch >= '0');
  x *= f;
}
vector<long long> primes;
template <class T>
bool isPrime(T x) {
  if (x <= 4 || x % 2 == 0 || x % 3 == 0) return x == 2 || x == 3;
  for (T i = 5; i * i <= x; i += 6)
    if (x % i == 0 || x % (i + 2) == 0) return 0;
  return 1;
}
int Tcnt = 0;
int dv[1000001];
template <class TT>
class ST {
  struct Node {
    int l, r;
    long long sm, bjc, bjj;
    long long min;
    long long max;
    long long oor;
    long long andd;
    vector<int> cnt;
  };
  vector<TT> A;
  vector<Node> T;

 public:
  ST(vector<TT>& AA) {
    A.emplace_back(0);
    for (int i = 0; i < AA.size(); i++) A.emplace_back(AA[i]);
    T.resize(A.size() << 2);
    build(1, 1, (int)A.size() - 1);
  }
  long long QuerySum(int l, int r) { return querySum(1, l, r); }
  void QueryCnt(int l, int r, vector<int>& cnt) {
    return queryCount(1, l, r, cnt);
  }
  long long QueryOr(int l, int r) { return queryOr(1, l, r); }
  long long QueryAnd(int l, int r) { return queryAnd(1, l, r); }
  long long QueryMax(int l, int r) { return queryMax(1, l, r); }
  long long QueryMin(int l, int r) { return queryMin(1, l, r); }
  void Add(int l, int r, TT x) { add(1, l, r, x); }
  void Mul(int l, int r, TT x) { mul(1, l, r, x); }

 private:
  void pushup(int i) {
    T[i].sm = T[i << 1].sm + T[i << 1 | 1].sm;
    T[i].max = max(T[i << 1].max, T[i << 1 | 1].max);
    T[i].min = min(T[i << 1].min, T[i << 1 | 1].min);
    T[i].oor = (T[i << 1].oor) | (T[i << 1 | 1].oor);
    T[i].andd = (T[i << 1].andd) & (T[i << 1 | 1].andd);
    for (int j = (1); j <= (40); j++)
      T[i].cnt[j - 1] = T[i << 1].cnt[j - 1] + T[i << 1 | 1].cnt[j - 1];
  }
  void mul(int i, TT x) {
    T[i].sm *= x;
    T[i].bjc *= x;
    T[i].bjj *= x;
  }
  void add(int i, TT x) {
    T[i].sm += x * (T[i].r - T[i].l + 1);
    T[i].max += x;
    T[i].min -= x;
    T[i].bjj += x;
    if (x == 0) return;
    if (x == 1) {
      for (int j = (1); j <= (40); j++)
        T[i].cnt[40 - (j - 1)] = T[i].cnt[40 - (j - 1) - 1];
      T[i].cnt[0] = 0;
    } else {
      int idx;
      for (idx = 0; idx < 40; idx++) {
        if (T[i].cnt[idx]) {
          T[i].cnt[idx] = 0;
          break;
        }
      }
      idx += x;
      if (idx >= 0 && idx < 40) T[i].cnt[idx] = 1;
    }
  }
  void pushdown(int i) {
    add(i << 1, T[i].bjj);
    add(i << 1 | 1, T[i].bjj);
    T[i].bjj = 0;
  }
  void build(int i, int l, int r) {
    T[i].l = l;
    T[i].r = r;
    T[i].bjc = 1, T[i].cnt.resize(40);
    if (l == r) {
      T[i].sm = A[l];
      T[i].min = A[l];
      T[i].max = A[l];
      T[i].oor = A[l];
      T[i].andd = A[l];
      if (A[l] < 40) T[i].cnt[A[l]] = 1;
      return;
    }
    int M = l + r >> 1;
    build(i << 1, l, M);
    build(i << 1 | 1, M + 1, r);
    pushup(i);
  }
  long long querySum(int i, int l, int r) {
    if (l <= T[i].l && T[i].r <= r) return T[i].sm;
    int M = T[i].l + T[i].r >> 1;
    long long ans = 0;
    pushdown(i);
    if (l <= M) ans += querySum(i << 1, l, r);
    if (r > M) ans += querySum(i << 1 | 1, l, r);
    return ans;
  }
  void queryCount(int i, int l, int r, vector<int>& cnt) {
    if (l <= T[i].l && T[i].r <= r) {
      for (int j = (1); j <= (40); j++) cnt[j - 1] += T[i].cnt[j - 1];
      return;
    }
    int M = T[i].l + T[i].r >> 1;
    pushdown(i);
    if (l <= M) queryCount(i << 1, l, r, cnt);
    if (r > M) queryCount(i << 1 | 1, l, r, cnt);
    return;
  }
  long long queryOr(int i, int l, int r) {
    if (l <= T[i].l && T[i].r <= r) return T[i].oor;
    int M = T[i].l + T[i].r >> 1;
    long long ans = 0;
    pushdown(i);
    if (l <= M) ans = queryOr(i << 1, l, r);
    if (r > M) ans |= queryOr(i << 1 | 1, l, r);
    return ans;
  }
  long long queryAnd(int i, int l, int r) {
    if (l <= T[i].l && T[i].r <= r) return T[i].andd;
    int M = T[i].l + T[i].r >> 1;
    long long ans = 0;
    pushdown(i);
    bool set = false;
    if (l <= M) ans = queryAnd(i << 1, l, r), set = true;
    if (r > M)
      ans =
          set ? (ans & queryAnd(i << 1 | 1, l, r)) : queryAnd(i << 1 | 1, l, r);
    return ans;
  }
  long long queryMax(int i, int l, int r) {
    if (l <= T[i].l && T[i].r <= r) return T[i].max;
    int M = T[i].l + T[i].r >> 1;
    long long ans = llmin;
    pushdown(i);
    if (l <= M) ans = max(ans, queryMax(i << 1, l, r));
    if (r > M) ans = max(ans, queryMax(i << 1 | 1, l, r));
    return ans;
  }
  long long queryMin(int i, int l, int r) {
    if (l <= T[i].l && T[i].r <= r) return T[i].min;
    int M = T[i].l + T[i].r >> 1;
    long long ans = llmax;
    pushdown(i);
    if (l <= M) ans = min(ans, queryMin(i << 1, l, r));
    if (r > M) ans = min(ans, queryMin(i << 1 | 1, l, r));
    return ans;
  }
  void addnew(int i, TT x) {
    T[i].sm = dv[T[i].sm];
    T[i].bjj = 0;
    T[i].max = T[i].sm;
    T[i].min = T[i].sm;
    return;
  }
  void add(int i, int l, int r, TT x) {
    if (l <= T[i].l && T[i].r <= r) {
      add(i, x);
      return;
    }
    int M = T[i].l + T[i].r >> 1;
    pushdown(i);
    if (l <= M) add(i << 1, l, r, x);
    if (r > M) add(i << 1 | 1, l, r, x);
    pushup(i);
  }
  void mul(int i, int l, int r, TT x) {
    if (l <= T[i].l && T[i].r <= r) {
      mul(i, x);
      return;
    }
    int M = T[i].l + T[i].r >> 1;
    pushdown(i);
    if (l <= M) mul(i << 1, l, r, x);
    if (r > M) mul(i << 1 | 1, l, r, x);
    pushup(i);
  }
};
struct less_than_key {
  inline bool operator()(const string& struct1, const string& struct2) {
    return (struct1.size() > struct2.size());
  }
};
long long func(long long n, long long m, long long r, long long x,
               long long y) {
  long long val =
      (min(n + 1, x + r) - max(x, r)) * (min(m + 1, y + r) - max(y, r));
  return val;
}
class triplet {
 public:
  long long x, y, val;
  triplet(long long _x, long long _y, long long _val)
      : x(_x), y(_y), val(_val){};
  inline bool operator<(const triplet& other) const { return val < other.val; }
};
bool sortbysec(const pair<int, int>& a, const pair<int, int>& b) {
  return (a.second < b.second);
}
const long long MAX_VALUE = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;
int ans = 0;
int n, m;
vector<int> edges[100001];
vector<int> ar;
bool DFS(int vtx, int cons, int par) {
  if (edges[vtx].size() == 1 && vtx != 1) {
    ans++;
    return true;
  }
  for (auto& ch : edges[vtx]) {
    if (ar[ch] + cons <= m && ch != par) {
      if (ar[ch] == 1)
        DFS(ch, ar[ch] + cons, vtx);
      else
        DFS(ch, 0, vtx);
    }
  }
  return true;
}
bool isPrime(long long x) {
  if (x <= 4 || x % 2 == 0 || x % 3 == 0) return x == 2 || x == 3;
  for (long long i = 5; i * i <= x; i += 6)
    if (x % i == 0 || x % (i + 2) == 0) return 0;
  return 1;
}
long long fac[41];
long long bill = 1000000000;
long long dp[101][101];
int b[100001];
int main() {
  std::cin.sync_with_stdio(false);
  std::cin.tie(nullptr);
  bool test = false;
  if (test) freopen("/Users/aj/code/HackerRank/input.txt", "r", stdin);
  int n;
  cin >> n;
  set<int> st;
  int mx = 0;
  for (int i = (1); i <= (2 * n); i++) {
    int v;
    cin >> v;
    if (st.find(v) == st.end())
      st.emplace(v);
    else
      st.erase(v);
    if (st.size() > mx) mx = st.size();
  }
  cout << mx;
}
