import copy

x = int(input());
s = list(input());

z = copy.copy(s);

j = 0;
p = 0;

for i in range(x):
    if str(s[i]) == '#':
        if i != x-1:
         if str(s[i+1]) == '.':
              j = j + 1;


for i in(range(x)):
    if str(z[i]) == '#':
        if i != 0:
         if str(z[i-1]) == '.':
              p = p + 1;

print(min(j,p));