from sys import exit

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

stack = []

black = 0
white = 0

for i in range(len(S)):
    if i == 0:
        if S[i] == '#':
            black += 1
    if S[i] == '.':
        white += 1

ans = len(S)
for i in range(len(S)):
    if ans > black + white:
        ans = black + white

    if i == 0:
        continue
    if S[i] == '.':
        white -= 1
    else:
        black += 1

print(ans)
