def kmer_count(k, rc=False):
    """
    Counts the number of possible k-mers

    Args:
        k (int): kmer size
        rc (bool): Use canonical k-mers
    Returns:
        int: number of possible kmers
    """
    if not rc:
        return 4**k

    n_palindromes = 0
    if k % 2 == 0:
        n_palindromes = 4**(k//2)
    return (4**k - n_palindromes) // 2 + n_palindromes