Number of Self-Divisible Permutations

Given an integer n, count permutations of [1,2,...,n] that are self-divisible: for each position i (1-indexed), the number at position i is divisible by i.

Examples
Input: 1
Output: 1
Hints

Number of Self-Divisible Permutations

Given an integer n, count permutations of [1,2,...,n] that are self-divisible: for each position i (1-indexed), the number at position i is divisible by i.