← Home
```go
package main

import (
	"fmt"
)

func main() {
	var x int
	fmt.Scan(&x)

	hasDigit := make([]bool, 10)
	temp := x
	for temp > 0 {
		hasDigit[temp%10] = true
		temp /= 10
	}

	count := 0
	for i := 1; i*i <= x; i++ {
		if x%i == 0 {
			if check(i, hasDigit) {
				count++
			}
			if i*i != x {
				if check(x/i, hasDigit) {
					count++
				}
			}
		}
	}
	fmt.Println(count)
}

func check(d int, hasDigit []bool) bool {
	for d > 0 {
		if hasDigit[d%10] {
			return true
		}
		d /= 10
	}
	return false
}
```