def number_of_divisors(n):
    """
    Number of divisors of n.

    >>> number_of_divisors(28)
    6
    """
    cnt = 1
    if n > 1:
        cnt += 1
    half = n//2
    for i in range(2, half+1):
        if n % i == 0:
            cnt += 1

    return cnt