import typing
from typing import Counter


def line_ngrams(line: str, n: int) -> typing.Counter[str]:
    """Returns Counter of `n`-grams in `line`."""
    grams: typing.Counter[str] = Counter()
    tkns = line.strip().split(' ')
    for start in range(len(tkns) - n + 1):
        grams[' '.join(tkns[start:start+n])] += 1
    return grams