import CoreFoundation

func is_prime( n:Int) -> Bool {
  var r : Int
  if ( n == 1 || n == 2 || n == 3 ) { return true }
  if ( n < 2 || n%2 == 0 ) { return false }
  if ( n < 9 ) { return true }
  if ( n%3 == 0 ) { return false }

  r = Int( sqrt( Double(n) ) )
  var f : Int  = 5
  while ( f <= r ) {
    //print ( "\t", f )
    if ( n%f == 0 ) { return true }
    if ( n%(f+2) == 0 ) { return false }
    f += 6
  }
  return true
}

func unittest( ) -> Void {
  print( is_prime(3) )
  print( is_prime(2) )
  print( is_prime(4) )
  print( is_prime(5) )
  print( is_prime(7) )
}

//unittest()

let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let m = arr[0]
let d = arr[1]

var i = 0; var j = 0
var range : [Int] = []
for i in 1...m {
	range.append(i)
}

var NewRange = range.filter{ !is_prime($0) } 
//print(NewRange)

var o = 0
i = 0
for i in range {
  //print( i )
  if( d < 22 ) {
    continue
  }
  for j in 22...d {
    var d_ten = j / 10
    var d_one = j % 10
    if( d_one < 2 || d_ten < 2 ) {
      continue
    }
    if( ( d_ten * d_one ) == i ) {
      o += 1
      //print( i, d_ten, d_one )
    }
  }
}

print( o )