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

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

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

 
print(max(k,j));