Little Chris knows there's no fun in playing dominoes, he thinks it's too random and doesn't require skill. Instead, he decided to play with the dominoes and make a "domino show".

Chris arranges n dominoes in a line, placing each piece vertically upright. In the beginning, he simultaneously pushes some of the dominoes either to the left or to the right. However, somewhere between every two dominoes pushed in the same direction there is at least one domino pushed in the opposite direction.

After each second, each domino that is falling to the left pushes the adjacent domino on the left. Similarly, the dominoes falling to the right push their adjacent dominoes standing on the right. When a vertical domino has dominoes falling on it from both sides, it stays still due to the balance of the forces. The figure shows one possible example of the process.

<image>

Given the initial directions Chris has pushed the dominoes, find the number of the dominoes left standing vertically at the end of the process!

Input

The first line contains a single integer n (1 ≤ n ≤ 3000), the number of the dominoes in the line. The next line contains a character string s of length n. The i-th character of the string si is equal to 

  * "L", if the i-th domino has been pushed to the left; 
  * "R", if the i-th domino has been pushed to the right; 
  * ".", if the i-th domino has not been pushed. 



It is guaranteed that if si = sj = "L" and i < j, then there exists such k that i < k < j and sk = "R"; if si = sj = "R" and i < j, then there exists such k that i < k < j and sk = "L".

Output

Output a single integer, the number of the dominoes that remain vertical at the end of the process.

Examples

Input

14
.L.R...LR..L..


Output

4


Input

5
R....


Output

0


Input

1
.


Output

1

Note

The first example case is shown on the figure. The four pieces that remain standing vertically are highlighted with orange.

In the second example case, all pieces fall down since the first piece topples all the other pieces.

In the last example case, a single piece has not been pushed in either direction.

import java.io.*;
import java.math.BigDecimal;
import java.nio.Buffer;
import java.util.*;

public class codeforces
{


   // public static long fact[];
   // public static int mod=1000000007;
    public static long []st;
    public static int k;
    public static int[][] grid;
    public static boolean[][] visit;
    public static long n;
    public static long b;
    public static int move=0;
    public static long MOD;

    static int []a ;
    static double []ans;
    public static long badCount=0;
    public static HashSet<String> hs;
    public static void main(String[] args) throws IOException {

        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n= in.nextInt();
        String dom = in.readString();
        int v = 0;
        for (int i=0;i<n;i++)
        {
            if(kt(i,n,dom))
                v++;

        }
        out.print(v);




        out.close();

        }
    static boolean kt(int i,int n , String s)
    {
        if (s.charAt(i)!='.') return false;
        int u,v;
        for(u=i-1;u>=0;--u) if (s.charAt(u)!='.') break;
        for(v=i+1;v<n;++v) if (s.charAt(v)!='.') break;
        if (u<0)
        {
            if (v>=n) return true;
            if (s.charAt(v)=='L') return false;
            return true;
        }
        if (s.charAt(u)=='L')
        {
            if (v>=n) return true;
            if (s.charAt(v)=='L') return false;
            return true;
        }
        if (v>=n || s.charAt(v)=='R') return false;
        return i-u==v-i;
    }



    public static int check(int n) {
        int m = n;
        int digit;
        int count = 0;
        while(m > 0) {
            digit = m % 10;
            m = m / 10;
            if(n % digit == 0) {
                count++;
            }
        }
        if(count >= 2) {
            return 1;
        } else {
            return 0;
        }
    }

    static boolean isPalindrome(int str[])
    {
        int l = 0;
        int h = str.length - 1;

        while (h > l)
        {
            if (str[l++] != str[h--])
            {
               return false;
            }
        }
      return true;
    }

    public static boolean isPrime(int n) {
        // Corner cases
        if (n <= 1)
            return false;
        if (n <= 3)
            return true;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n % 2 == 0 || n % 3 == 0)
            return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }
    public static int lcs(char []aa,char []bb , int n,int m)
    {
        int [][]l=new int[n+1][m+1];
        for (int i=0;i<=n;i++)
        {
            for (int j=0;j<=m;j++)
            {
                if(i==0 || j==0)
                {
                    l[i][j]=0;
                }else if(aa[i-1]==bb[j-1])
                {
                    l[i][j]=1+l[i-1][j-1];
                }else
                {
                    l[i][j]=Math.max(l[i-1][j],l[i][j-1]);
                }
            }
        }
        return l[n][m];

    }


    public static int bs(int []search,int target)
    {
        int low=0;
        int high=search.length-1;
        int ans=0;
        while (low<=high) {
            int mid = (low + high) >> 1;
            if (search[mid] <= target) {
                ans = mid;
                low = mid + 1;
            } else {
                high = mid - 1;
            }
        }
        return ans;

    }

   public static long ts(long start, long end)
    {
        long l = start, r = end;

        for(int i=0; i<200; i++) {
            long l1 = (l*2+r)/3;
            long l2 = (l+2*r)/3;

            if(fc(l1) > fc(l2))
                r = l2;
            else
                l = l1;
        }

       long x=l;

        return x;
    }
    public static long fc(long x) {

        return x*(n-x*b);
    }

    public static int bfs(int i,int j,int n,int m)
    {
        int troop=0;
        Queue<node> qq=new LinkedList<>();
        qq.add(new node(i,j));
        while (!qq.isEmpty())
        {
            node cur=qq.poll();
            troop++;
            for (int r=-1;r<=1;r++)
            {
                for (int c=-1;c<=1;c++)
                {
                    if(cur.x+r>=0 && cur.x+r<n && cur.y+c>=0 && cur.y+c<m)
                    {
                        if(!visit[cur.x+r][cur.y+c])
                        {
                            visit[cur.x+r][cur.y+c]=true;
                            if(grid[cur.x+r][cur.y+c]==1)
                            {
                                qq.add(new node(cur.x+r,cur.y+c));
                            }

                        }
                    }

                }
            }
        }
        return troop;


    }

    static class node{

        int x;
        int y;

        public node(int x, int y) {
            this.x = x;
            this.y = y;
        }
    }




    public static int nextPowerOf2(final int a) {
        int b = 1;
        while (b < a) {
            b = b << 1;
        }
        return b;
    }

    public static long []contruct(long []a)

    {
        int next2power=nextPowerOf2(a.length);
        st=new long[next2power*2-1];
        //System.out.println(size);
        // st=new long[size];
        Arrays.fill(st,Integer.MAX_VALUE);
        constructST(a,0,a.length-1,0);
        return st;



    }
    public static void constructST(long []a,int start,int end,int pos)
    {
        if(start==end)
        {
            st[pos]=a[start];
            return ;
        }
        int mid=(start+end)>>1;
        constructST(a,start,mid,pos*2+1);
        constructST(a,mid+1,end,pos*2+2);
        st[pos]=st[2*pos+1]^st[2*pos+2];


    }

       static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}