import sys
n = int(input())
s = input()

if all(c == s[0] for c in s):
    print(n)
    sys.exit()

cnt = 0
c_prev = s[0]
t = ""
for i, c in enumerate(s):
    if c_prev == '#' and c == '.':
        t += "#"
        cnt += 1
    else:
        t += c
    c_prev = c

# print(s)
# print(t)
print(cnt)
