← Home
```go
package main

import (
	"fmt"
	"strconv"
)

func getDivisors(x int64) []int64 {
	var divisors []int64
	for i := int64(1); i*i <= x; i++ {
		if x%i == 0 {
			divisors = append(divisors, i)
			if i != x/i {
				divisors = append(divisors, x/i)
			}
		}
	}
	return divisors
}

func hasCommonDigit(a, b int64) bool {
	strA := strconv.FormatInt(a, 10)
	strB := strconv.FormatInt(b, 10)
	setA := make(map[rune]bool)
	for _, ch := range strA {
		setA[ch] = true
	}
	for _, ch := range strB {
		if setA[ch] {
			return true
		}
	}
	return false
}

func main() {
	var x int64
	fmt.Scan(&x)
	divisors := getDivisors(x)
	count := 0
	for _, d := range divisors {
		if hasCommonDigit(x, d) {
			count++
		}
	}
	fmt.Println(count)
}
```