N = int(input())
S = input()
cnt = 0
i = 0
j = N-1
while j > i:
        while S[i] == '.':
                i = i + 1
        cnt = cnt + 1
        i = i + 1
        while S[j] == '#':
                j = j -1

        if j <= i:
                break
        cnt = cnt + 1
        j = j - 1
print(cnt)