x = int(input());
s=list(input());
 
j = 0;
k = 0;

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

for i in range(len(s)):
    if str(s[i]) == '#':
        if i != len(s) - 1:
          if str(s[i+1]) == '.':
              s[i] = '.';
              k = k + 1;
 
print(max(k,j));