N = int(input())
S = list(input())
S1 = S[:]
S2 = S[:]
S3 = S[:]
S4 = S[:]
output1 = 0
output2 = 0
output3 = 0
output4 = 0

for i in range(N):
    if S1[i] == "." :
        S1[i] = "#"
        output1 += 1
for j in range(N):
    if S2[j] == "#":
        S2[j] == "."
        output2 += 1

flag = 0
if S3[0]=="#":
    S3[0]="."
    output3 += 1
for k in range(N):
    if (S3[k] == ".") and (flag==1):
        S3[k] == "#"
        output3 += 1
    if (S3[k] == "#") and (flag==0):
        flag = 1


flag = 0
if S4[N-1]==".":
    S4[N-1]="#"
    output4 += 1
for l in range(N):
    if (S4[N-1-l] == "#") and (flag==1):
        S4[N-1-l] == "."
        output4 += 1
    if (S4[N-1-l] == ".") and (flag==0):
        flag = 1

output = min(output1,output2,output3,output4)
print(output)