N = int(input())
S = input()
s = [S[i: i + 1] for i in range(N)]
ans = 0
bflag = 0
for i, st in enumerate(s):
    if bflag == 1:
        if st == '.':
            ans += 1
        else:
            bflag = 0
    else:
        if st == '#':
            bflag = 1
wflag = 0
ans2 = 0
for i in range(1, N + 1):
    if wflag == 1:
        if s[-i] == '#':
            ans2 += 1
        else:
            wflag == 0:
    else:
        if s[-i] == '.':
            wflag == 1
print(min(ans, ans2))
