n = int(input())
s = input()
c = 0
for i in range(0,n) :
    if s[i] == '#' and s[i] == s[i+1] :
        c += 0
    elif s[i] == '#' and s[i] != s[i+1] :
        c += 1
    else :
        c += 0
print(c)