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

count = 0
while True:
    if "".join(S[:2]) == "#.":
        S[0] = "."
        count += 1
    if "".join(S[-2:]) == "#.":
        S[-1] = "#"
        count += 1
    S = S[2:-2]
    if not S:
        break
        
print(count)