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

sha_flag = False

sha_num = 0
dot_num = 0

# "(" = "#" 
# ")" = "."

for i in range(N):

    if sha_flag == False:
        if S[i] == "#":
            sha_flag = True
    else:
        if S[i] == ".":
            dot_num += 1

    if S[i] == "#":
        sha_num += 1

print(min(sha_num,dot_num))