n = int(input())
S = input()
flag = False
ans1 = 0
for s in S:
    if s=='#':
        flag = True
    elif flag:
        ans1 += 1
flag = False
ans2 = 0
for s in S[::-1]:
    if s=='.':
        flag = True
    elif flag:
        ans2 += 1
print(min(ans1, ans2))