x = int(input());
s=list(input());
 
j = 0;
 
for i in range(len(s)):
    if str(s[i]) == '#':
        if i != len(s) - 1:
          if str(s[i+1]) == '.':
              s[i] = '.';
              j = j + 1;
 
print(j);