def paint_black():
    hasBlack = False
    count = 0
    for char in S:
        if char == '.' and hasBlack:
            count += 1
        if char == '#' and not hasBlack:
            hasBlack = True
    return count

def paint_white():
    hasWhite = False
    count = 0
    for char in reversed(S):
        if char == '#' and hasWhite:
            count += 1
        if char == '.' and not hasWhite:
            hasWhite = True
    return count

if __name__ == "__main__":
    N = int(input())
    S = input()
    print(min(paint_black(), paint_white()))
