N = int(input())
S = input()
count1 = 0
count2 = 0
s = list(S)

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

for j in range(N - 1):
    if s[j]=='#' and s[j + 1]=='.':
        s[j+1] = s[j]
        count2 += 1

if count1 < count2:
    print(count1)
else:
    print(count2)