N = int(input())
S = input()
cnt = 0
i = 0
j = N-1
while True:
        while S[i] == '.':
                i = i + 1
        while S[j] == '#':
                j = j -1
        #print((i, j))
        if i > j:
                break
        elif i + 1 == j:
                cnt = cnt + 1
                break
        else:
                cnt = cnt + 2
        i = i + 1
        j = j - 1

print(cnt)