N = int(input())
S = list(input())

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

print(count)