def eat_blank(Q):
    """Discards a sequence of blank chars at the top of Q"""
    n = len(Q)
    while Q:
        if Q[0] in ' \t\n':
            Q.popleft()
        else:
            break
    return n - len(Q)