N = int(input())
S = input()
count = 0
count2 = 0

for x in range(N):
    if S[x] == '#':
        flag = True
    if S[x] == '.' and flag == True:
        count += 1

for x in range(N)[::-1]:
    if S[x] == '.':
        flag = True
    if S[x] == '#' and flag == True:
        count2 += 1

print(max(count,count2))