def main():
    n = int(input())
    s = list(input())

    bstone = [0]*n
    wstone = [0]*n

    bstone[0] = 1 if s[0]=='#' else 0
    wstone[-1] = 1 if s[-1]=='.' else 0

    for i in range(n-1):
        bstone[i+1] = bstone[i]
        if s[i]=='#':
            bstone[i+1]+=1
    
    for i in range(n-1)[::-1]:
        wstone[i] = wstone[i+1]
        if s[i]=='.':
            wstone[i]+=1

    bstone.insert(0,0)
    wstone.append(0)

    ans = []
    for i in range(n):
        t = bstone[i]+wstone[i+1]
        ans.append(t)
    print(min(ans))

if __name__ == "__main__":
    main()