from itertools import accumulate
def main():
    N=int(input())
    line = list(input())
    ans=[]

    for i in range(N+1):
        a=line[:i].count("#")
        b=line[i:].count(".")
        ans.append(a+b)
    return min(ans)

print(main())