from typing import Union
from pathlib import Path


def count_fasta_seq(fasta_file: Union[str, Path]) -> int:
    """Count fasta sequence number

    Args:
        fasta_file (Union[str, Path]): Fasta format file

    Returns:
        int: Fasta sequence number
    """
    with open(fasta_file) as f:
        return len(list(filter(lambda l: l.startswith(">"), f.readlines())))