N = input()
S = input()
f = 0
c = 0
if S[0] == '#':
    f = 0
else:
    f = 1
for i, s in enumerate(S):
    if s == '#' and f == 1:
        f = 0
        c += 1
    elif s == '.' and f == 0:
        f = 1
        c += 1
print(c)
