object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  
  val list = for {
    a <- 1 to n
    b <- 1 to n
    if a.toString.head == b.toString.reverse.head
    if b.toString.head == a.toString.reverse.head
  } yield (a, b)
  println(list.length)
}