import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline



def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [int(input_raw[0])]
    input_raw = read_func().strip().split()
    S = input_raw[0]

    new_S = ""
    count = 0
    for i in range(N):
        if S[i] != "#":
            count += 1
    min_count = count
    for i in range(N):
        if S[i] == ".":
            count -= 1
        else:
            count += 1
        min_count = min(min_count, count)
    print min_count


##    new_S1 = ""
##    new_S2 = ""
##    flag = False
##    for i in range(N):
##        if S[i] == "." and flag == False:
##            new_S1 += "."
##        else:
##            new_S1 += "#"
##            flag = True
##
##    flag = False
##    for i in range(N):
##        if S[N - i - 1] == "#" and flag == False:
##            new_S2 += "#"
##        else:
##            new_S2 += "."
##            flag = True
##    count1 = 0
##    count2 = 0
##    new_S2 = new_S2[::-1]
##    for i in range(N):
##        if S[i] != new_S1[i]:
##            count1 += 1
##        if S[i] != new_S2[i]:
##            count2 += 1
##    print min(count1, count2)


if __name__ == '__main__':
    main()
