N = int(input())
S = input()
ans1 = 0
flag = False

for s in S:
    if s == '#':
        flag = True
    if flag and s == '.':
        ans1 += 1

ans2 = 0
flag = False
cnt = 0
for s in S:
    if s == '#':
        cnt += 1
    else:
        ans2 += cnt
        cnt = 0

print(min(ans1, ans2))

