n = int(input())
s = list(input())
counter = 0

if n == 1:
    print(0)
else:
    siro = s.count(".")
    kuro = n-siro
    if siro > kuro:
        for i in range(1,n):
            if s[i-1] =="#" and s[i] == ".":
                counter += 1
    elif kuro > siro:
        for i in range(n-1):
            if s[i] =="#" and s[i+1] == ".":
                counter +=1
                
    print(counter)