import java.util.Scanner

object Main {
  type T = Int

  sealed abstract class Node

  case class Branch(value: T, priority: Double, left: Node, right: Node) extends Node

  case object Leaf extends Node

  class MySet(val root: Node) {
    def insert(value: T): (MySet, Boolean) = if (contains(value)) {
        (new MySet(root), false)
      } else {
      val (left, right) = split_less(root, value)
      val single = Branch(value, math.random, Leaf, Leaf)
      (new MySet(merge(merge(left, single), right)), false)
    }

    def erase(value: T): (MySet, Boolean) = if (contains(value)) {
        val (left, tmp) = split_less(root, value)
        val (_, right) = split_leq(tmp, value)
        (new MySet(merge(left, right)), true)
      } else {
      (new MySet(root), false)
    }

    def contains(value: T): Boolean = find(root, value)

    def toList(): List[T] = makeList(root)
  }

  def merge(left: Node, right: Node): Node = (left, right) match {
    case (Leaf, r) => r
    case (l, Leaf) => l
    case (l: Branch, r: Branch) => {
      if (l.priority > r.priority) {
        Branch(l.value, l.priority, l.left, merge(l.right, right))
      } else {
        Branch(r.value, r.priority, merge(left, r.left), r.right)
      }
    }
  }

  def split_less(node: Node, value: T): (Node, Node) = node match {
    case Leaf => (Leaf, Leaf)
    case Branch(x, p, l, r) => {
      if (x < value) {
        val (rl, rr) = split_less(r, value)
        (Branch(x, p, l, rl), rr)
      } else {
        val (ll, lr) = split_less(l, value)
        (ll, Branch(x, p, lr, r))
      }
    }
  }

  def split_leq(node: Node, value: T): (Node, Node) = node match {
    case Leaf => (Leaf, Leaf)
    case Branch(x, p, l, r) => {
      if (x <= value) {
        val (rl, rr) = split_leq(r, value)
        (Branch(x, p, l, rl), rr)
      } else {
        val (ll, lr) = split_leq(l, value)
        (ll, Branch(x, p, lr, r))
      }
    }
  }

  def find(node: Node, value: T): Boolean = node match {
    case Leaf => false
    case Branch(x, _, l, r) => {
      if (value < x) find(l, value)
      else if (x == value) true
      else find(r, value)
    }
  }

  def makeList(tree: Node): List[T] = tree match {
    case Leaf => Nil
    case Branch(x, _, l, r) => makeList(l) ++ List(x) ++ makeList(r)
  }

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n = sc.nextInt

    var s = new MySet(Leaf)
    for (_ <- 0 until n) s = s.insert(sc.nextInt)._1
    val ls = s.toList()
    // println(ls)
    println(ls.length)
  }
}