Write a Python function `count_divisors(n: int) -> int` that calculates the number of divisors of a given positive integer `n`.
A divisor of a number is an integer that divides the number without leaving a remainder. For example, the divisors of `12` are `1, 2, 3, 4, 6, 12`.
#### Example Usage
```python [main.nopy]
print(count_divisors(15)) # Output: 4 (divisors are 1, 3, 5, 15)
print(count_divisors(12)) # Output: 6 (divisors are 1, 2, 3, 4, 6, 12)
print(count_divisors(9)) # Output: 3 (divisors are 1, 3, 9)
```
#### Constraints
- The input `n` will be a positive integer greater than 0.