# -*- coding: utf-8 -*-

from sys import stdin
    
def calc(n, s):
    b = '#'
    w = '.'
    last = ''

    s2 = [ c == '#' for c in s]
    ans =[sum(s2[:i])+n-i-sum(s2[i:]) for i in range(n+1)]
    return min(ans)

def main():
    n = int(stdin.readline().rstrip())
    s = stdin.readline().rstrip()
    ans = calc(n, s)
    print(ans)
    
if __name__=='__main__':
    main()