N = int(input())
S = input()

li = list(S)
temp1 = 0
temp2 = 0
count = 0

for i in range(N-1):
    if '#' == li[i] and '.' == li[i+1]:
        li[i] = '.'
        temp1 += 1

li = list(S)
for i in range(N-1):
    if '#' == li[i] and '.' == li[i+1]:
        li[i+1] = '#'
        temp2 += 1

count = min(temp1, temp2)
print(count)
