N = int(input())
S = list(input())
count = 0
flag = True
start = 1

while flag:
    for i in range(start,N):
        if S[i] == '.':
            if S[i-1] == "#":
                S[i-1] = "."
                count += 1
                start = i
                break
        if i == N-1:
            flag = False

print(count)