from typing import Tuple


def cnnxfc_params(
    image_size: Tuple[int, int], n_channels: int, out_features: int, bias: bool = True
):
    """
    Return the number of parameters in a CNN followe by a linear layer.
    Args:
        image_size: Size of the output of the CNN.
        n_channels: Number of the image's channels.
        out_features: Neurons in the linear layer.
        bias: If true count bias.
    Returns:
        Number of parameters.
    """
    w, h = image_size
    weights = w * h * n_channels * out_features
    biases = out_features if bias else 0
    return weights + biases