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

# if (S not in "#"):
#     print("0")
#     exit()
count = 0
ans = 0
revcount = 0
Flag = False
for i in range(N-1,-1,-1):
    if S[i] == ".":
        Flag = True
        count+=1
    else:
        if Flag != False:
            revcount+=1
        ans+=count
        count=0
print(min(revcount,ans))