# TPBC201C - Stones
n = int(input())
s1 = list(input())
s2 = s1
count_1 = 0
count_2 = 0

for i in range(n - 1):
    if s1[i] == '#' and s1[i + 1] == '.':
        s1[i + 1] = '#'
        count_1 += 1
        
for i in range(1, n):
    if s2[i] == '.' and s2[i - 1] == '#':
        s2[i - 1] = '.'
        count_2 += 1
        
print(min(count_1, count_2))