n = int(input())
s = input()

def all_black():
    first_black = -1
    for i in range(n):
        if s[i] == '#':
            first_black = i
            break

    result = 0
    if first_black > -1:
        for i in range(first_black, n):
            if s[i] == '.':
                result += 1

    return result

def all_white():
    result = 0
    for i in range(n):
        if s[i] == '#':
            result += 1
    
    return result

result = min([all_black(), all_white()])
print(result)