N = int(input())
S = input()

num = S[:-1].count("#")

if num >= N - 1 - num :
    if S[N-1] == "#":
        print(N - 1 - num)
    else:
        print(N-num)
else:
    if S[N-1] == ".":
        print(num)
    else:
        print(num+1)