n=int(input())
s=input()

si=[]
k=[]
count = 0
flag = 0
flag2 = 0

for i in range(0,n):
    if flag == 0:
        if s[i] == '.':
            count += 1
            if i == n-1:
                si.append(count)

        else:

            si.append(count)
            count = 1
            flag = 1
            if i == n-1:
                k.append(count)
                flag2 = 1

    else:
        if s[i] == '#':
            count += 1
            if i == n-1:
                k.append(count)
                flag2 = 1
        else:
            k.append(count)
            count = 1
            flag = 0
            if i == n-1:
                si.append(count)

#
# if len(si)>0:
#     sa=si[0]
# else:
#     sa=0
#
# if flag2 == 1:
#     if len(k)>0:
#         ka=k[-1]
#     else: ka = 0
# else: ka = 0
#
# smax = sum(si) - sa
#
# kmax = sum(k) - ka
#
# ans = min(smax,kmax)
# print(ans)

lenall = len(si) + len(k)
ans = 1000
temp = 1000
for i in range(0,lenall):
    temp = sum(k[:int(i/2)]) + sum(si[int(i/2)+1:])
    if temp <= ans:
        ans = temp

print(ans)