def METHOD_NAME(session: DbSession, file_hash: str) -> int:
    select_count_stmt = select(func.count()).select_from(
        select(FilePinDb).where(FilePinDb.file_hash == file_hash)
    )
    return session.execute(select_count_stmt).scalar_one()