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

count = 0

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

print(count)