def kari():
    N = list(map(int, input().split()))
    A, B = map(int, input().split())

def main():
    N = int(input())
    S = list(input())

    flg = 0
    ans = 0
    for i in range(N):
        if S[i] == '#':
            flg = 1
        if flg and S[i] == '.':
            ans += 1

    flg = 0
    ans_2 = 0
    for i in range(N)[::-1]:
        if S[i] == '.':
            flg = 1
        if flg and S[i] == '#':
            ans_2 += 1

    print(min(ans, ans_2))




if __name__ == '__main__':
    main()
