N=int(input())
S=input()
i=0
m=N-1
cnt_1=0
cnt_2=0

while S[i]==".":
    i+=1
while S[m]=="#":
    m-=1

for x in range(i,m):
    if S[x]==".":
        S[x]="#"
        cnt_1+=1
for x in range(i,m):
    if S[x]=="#":
        S[x]="."
        cnt_2+=1

if cnt_1>=cnt_2:
    print(cnt_2)
else:
    print(cnt_1)

