import java.io.*;
import java.lang.*;
import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] args) throws IOException {

		、、BufferedReader cin = new BufferedReader(new FileReader("test.txt"));
		 BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));

		String line;
		//StringTokenizer st;

		line = cin.readLine();
		//st = new StringTokenizer(line);

		int n = Integer.parseInt(line);
		//int a = Integer.parseInt(st.nextToken());
		//int b = Integer.parseInt(st.nextToken());

		line=cin.readLine();

		int opt = 0;//0 empty,1 all L, 2 all R, 3 RRLL
		int left=0;
		int mid=-1;
		int right=n-1;
		int start=-1;
		int end=-1;
		char tmp;
		for(int i=0;i<n;i++){
			tmp=line.charAt(i);
			if(tmp!='.'&&opt==0)left=i;
			if(tmp=='L'){
				if(opt==0)opt=1;
				if(opt==2){
					opt=3;
					mid=i;
				}
			}
			if(tmp=='R')opt=2;
			if(tmp=='.'&&opt!=0)right=i-1;
		}

		switch(opt){
		case 0:start=1;end=1;break;
		case 1:start=right+1;end=left;break;
		case 2:start=left+1;end=right+2;break;
		case 3:start=left+1;end=mid;break;
		}

		System.out.println(start+" "+end);

		cin.close();
	}

}


import java.io.*;
import java.lang.*;
import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] args) throws IOException {

		//BufferedReader cin = new BufferedReader(new FileReader("test.txt"));
		 BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));

		String line;
		//StringTokenizer st;

		line = cin.readLine();
		//st = new StringTokenizer(line);

		int n = Integer.parseInt(line);
		//int a = Integer.parseInt(st.nextToken());
		//int b = Integer.parseInt(st.nextToken());

		line=cin.readLine();

		int opt = 0;//0 empty,1 all L, 2 all R, 3 RRLL
		int left=0;
		int mid=-1;
		int right=n-1;
		int start=-1;
		int end=-1;
		char tmp;
		for(int i=0;i<n;i++){
			tmp=line.charAt(i);
			if(tmp!='.'&&opt==0)left=i;
			if(tmp=='L'){
				if(opt==0)opt=1;
				if(opt==2){
					opt=3;
					mid=i;
				}
			}
			if(tmp=='R')opt=2;
			if(tmp=='.'&&opt!=0){
				right=i-1;
				break;//Mistake!!!!!!!
			}
		}

		switch(opt){
		case 0:start=1;end=1;break;
		case 1:start=right+1;end=left;break;
		case 2:start=left+1;end=right+2;break;
		case 3:start=left+1;end=mid;break;
		}

		System.out.println(start+" "+end);

		cin.close();
	}

}


import java.io.*;
import java.lang.*;
import java.util.*;
import java.text.*;

public class Main {

	public static void main(String[] args) throws IOException {

		//BufferedReader cin = new BufferedReader(new FileReader("test.txt"));
		 BufferedReader cin = new BufferedReader(new InputStreamReader(System.in));

		String line;
		//StringTokenizer st;

		line = cin.readLine();
		//st = new StringTokenizer(line);

		int n = Integer.parseInt(line);
		//int a = Integer.parseInt(st.nextToken());
		//int b = Integer.parseInt(st.nextToken());

		line=cin.readLine();

		int opt = 0;//0 empty,1 all L, 2 all R, 3 RRLL
		int left=0;
		int mid=-1;
		int right=n-1;
		int start=-1;
		int end=-1;
		char tmp;
		for(int i=0;i<n;i++){
			tmp=line.charAt(i);
			if(tmp!='.'&&opt==0)left=i;
			if(tmp=='L'){
				if(opt==0)opt=1;
				if(opt==2){
					opt=3;
					mid=i;
				}
			}
			if(tmp=='R')opt=2;
			if(tmp=='.'&&opt!=0)right=i-1;
		}

		switch(opt){
		case 0:start=1;end=1;break;
		case 1:start=right+1;end=left;break;
		case 2:start=left+1;end=right+2;break;
		case 3:start=left+1;end=mid;break;
		}

		System.out.println(start+" "+end);

		cin.close();
	}

}


import java.util.*;
import java.lang.*;
import java.util.Scanner;
import java.io.*;

public class A298
{
	public static void main (String[] args)
	{
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        in.nextLine();
        String S=in.nextLine();
        int r=S.indexOf('R');
        int l=S.indexOf('L');
        if(r>=0&&l>=0){
            System.out.println(r+1+" "+l);
        }
        else if(r>=0)
        {
            System.out.println(r+1+" "+(S.lastIndexOf('R')+2));
        }
        else
        {
            System.out.println(S.lastIndexOf('L')+1+" "+l);
        }
    }
}


import java.util.*;
import java.lang.*;
import java.util.Scanner;
import java.io.*;

public class A298
{
	public static void main (String[] args)
	{
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        in.nextLine();
        String S=in.nextLine();
        int r=S.indexOf('R');
        int l=S.indexOf('L');
        if(r>=0&&l>=0){
            System.out.println(r+1+" "+l);
        }
        else if(r>=0)
        {
            System.out.println(r+1+" "+(S.lastIndexOf('R')+2));
        }
        else
        {
            System.out.println(S.lastIndexOf('L')+" "+l);
        }
    }
}


import java.util.*;
import java.io.*;
//267630EY
public class Main298A
{
  static PrintWriter out=new PrintWriter(System.out);

  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    String st=sc.next();
    char[] c=st.toCharArray();
    int s=-1;
    int t=-1;
    boolean R=false;
    boolean L=false;

    for(int i=0;i<n;i++)
    {
      if(c[i]!='.')
      {
        if(c[i]=='R')
        {
          R=true;
          s=i+1;
        }
        if(c[i]=='L')
        {
          L=true;
          t=i;
        }
        break;
      }
    }
    if(R)
    {
      t=s;
      for(int i=s;i<n;i++)
      {
        if(c[i]=='.')
          break;
        else if(c[i]=='L')
        {
          break;
        }
        else
          t++;
      }
      out.println(s+" "+t);
    }
    else
    {
      s=t+1;
      for(int i=s;i<n;i++)
      {
        if(c[i]=='.')
          break;
        else if(c[i]=='L')
        {
          s++;
          continue;
        }
      }
      out.println(s+" "+t);
    }
    out.flush();

  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
import java.io.*;
//267630EY
public class Main298A
{
  static PrintWriter out=new PrintWriter(System.out);

  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    String st=sc.next();
    char[] c=st.toCharArray();
    int s=-1;
    int t=-1;
    boolean R=false;
    boolean L=false;

    for(int i=0;i<n;i++)
    {
      if(c[i]!='.')
      {
        if(c[i]=='R')
        {
          R=true;
          s=i+1;
        }
        if(c[i]=='L')
        {
          L=true;
          t=i;
        }
        break;
      }
    }
    if(R)
    {
      t=s+1;
      for(int i=s;i<n;i++)
      {
        if(c[i]=='.')
          break;
        else if(c[i]=='L')
        {
          t--;
          break;
        }
        else
          t++;
      }
      out.println(s+" "+t);
    }
    else
    {
      s=t+1;
      for(int i=s;i<n;i++)
      {
        if(c[i]=='.')
          break;
        else if(c[i]=='L')
        {
          s++;
          continue;
        }
      }
      out.println(s+" "+t);
    }
    out.flush();

  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.*;
import java.io.*;

public class Main298A
{
  static PrintWriter out=new PrintWriter(System.out);

  public static void main(String[] args) throws IOException
  {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    String s=sc.next();
    int t=0;
    int st=0;
    if(s.contains("L")&&s.contains("R"))
    {
      //out.println("S");
      for(int i=0;i<n;i++)
      {
        if(s.charAt(i)=='L')
        {
          t=i;
          break;
        }
      }
      for(int i=0;i<n;i++)
      {
        if(s.charAt(i)=='R')
        {
          st=i+1;
          break;
        }
      }
    }
    else if(s.contains("L")&&!s.contains("R"))
    {
      boolean found=false;
      for(int i=0;i<n;i++)
      {
        if(s.charAt(i)=='L'&&!found)
        {
          t=i;
          found=true;
        }
        if(s.charAt(i)=='.'&&found)
        {
          st=i;
          break;
        }
      }
    }
    else if(s.contains("R")&&!s.contains("L"))
    {
      boolean found=false;

      for(int i=0;i<n;i++)
      {
        if(s.charAt(i)=='R'&&!found)
        {
          st=i+1;
          found=true;
        }
        if(s.charAt(i)=='.'&&found)
        {
          t=i+1;
          break;
        }
      }
    }
    out.println(st+" "+t);

    out.flush();

  }
  static class Scanner
  {
    BufferedReader br;
    StringTokenizer tk=new StringTokenizer("");
    public Scanner(InputStream is)
        {
      br=new BufferedReader(new InputStreamReader(is));
    }
        public int nextInt() throws IOException
        {
          if(tk.hasMoreTokens())
                return Integer.parseInt(tk.nextToken());
          tk=new StringTokenizer(br.readLine());
          return nextInt();
        }
        public long nextLong() throws IOException
        {
            if(tk.hasMoreTokens())
              return Long.parseLong(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextLong();
        }
        public String next() throws IOException
        {
          if(tk.hasMoreTokens())
            return (tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return next();
        }
        public String nextLine() throws IOException
        {
          tk=new StringTokenizer("");
          return br.readLine();
        }
        public double nextDouble() throws IOException
        {
            if(tk.hasMoreTokens())
              return Double.parseDouble(tk.nextToken());
            tk=new StringTokenizer(br.readLine());
            return nextDouble();
        }
        public char nextChar() throws IOException
        {
            if(tk.hasMoreTokens())
              return (tk.nextToken().charAt(0));
            tk=new StringTokenizer(br.readLine());
            return nextChar();
        }
        public int[] nextIntArray(int n) throws IOException
        {
            int a[]=new int[n];
            for(int i=0;i<n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArray(int n) throws IOException
        {
          long a[]=new long[n];
            for(int i=0;i<n;i++)
              a[i]=nextLong();
            return a;
        }
        public int[] nextIntArrayOneBased(int n) throws IOException
        {
          int a[]=new int[n+1];
            for(int i=1;i<=n;i++)
              a[i]=nextInt();
            return a;
        }
        public long[] nextLongArrayOneBased(int n) throws IOException
        {
          long a[]=new long[n+1];
          for(int i=1;i<=n;i++)
                a[i]=nextLong();
          return a;
        }
  }
}


import java.util.Scanner;

public class CF298AShowFootprints {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		s.nextLine();
		String l =s.nextLine();
		char act = '.';
		int x = 0;
		String ans="";
		if(l.contains("R")&&l.contains("L")) {
			for (int i = 0; i < n; i++) {
				if(l.charAt(i)!=act) {
					if(l.charAt(i)=='R') {
						ans+=(i+1)+" ";
					}else {
						ans+=i+" ";
					}
					act=l.charAt(i);
					x++;
				}
				if(x==2) {
					break;
				}
			}
		}else if(l.contains("R")) {
			for (int i = 0; i < n; i++) {
				if(l.charAt(i)!=act) {
					ans+=(i+1)+" ";
					act=l.charAt(i);
					x++;
				}
				if(x==2) {
					break;
				}
			}
		}else {
			for (int i = 0; i < n; i++) {
				if(l.charAt(i)!=act) {
					if(x==0) {
						ans=(i)+" "+ans;
					}else {
						ans=(i+1)+" "+ans;
					}

					act=l.charAt(i);
					x++;
				}
				if(x==2) {
					break;
				}
			}
		}

		System.out.println(ans);
	}

}


import java.util.Scanner;

public class CF298AShowFootprints {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		s.nextLine();
		String l =s.nextLine();
		char act = '.';
		int x = 0;
		String ans="";
		if(l.contains("R")&&l.contains("L")) {
			for (int i = 0; i < n; i++) {
				if(l.charAt(i)!=act) {
					if(l.charAt(i)=='R') {
						ans+=(i+1)+" ";
					}else {
						ans+=i+" ";
					}
					act=l.charAt(i);
					x++;
				}
				if(x==2) {
					break;
				}
			}
		}else if(l.contains("R")) {
			for (int i = 0; i < n; i++) {
				if(l.charAt(i)!=act) {
					ans+=(i+1)+" ";
					act=l.charAt(i);
					x++;
				}
				if(x==2) {
					break;
				}
			}
		}else {
			for (int i = 0; i < n; i++) {
				if(l.charAt(i)!=act) {
					ans=(i)+" "+ans;
					act=l.charAt(i);
					x++;
				}
				if(x==2) {
					break;
				}
			}
		}

		System.out.println(ans);
	}

}


import java.util.Scanner;

public class CF298AShowFootprints {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		s.nextLine();
		String l =s.nextLine();
		char act = '.';
		int x = 0;
		String ans="";
		for (int i = 0; i < n; i++) {
			if(l.charAt(i)!=act) {
				if(l.charAt(i)=='R') {
					ans+=(i+1)+" ";
				}else {
					ans+=i+" ";
				}
				act=l.charAt(i);
				x++;
			}
			if(x==2) {
				break;
			}
		}
		System.out.println(ans);
	}

}


import javax.print.DocFlavor;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int firstPostionL =0;
        int firstPostion =0;
        int secondPostionl = 0;
        int secondPostion = 0;
        int n = input.nextInt();
        input.nextLine();
        String gh = input.nextLine();
        for (int i =0;i<gh.length();i++){
            if (gh.charAt(i)=='R'){
                firstPostion = i+1;
                break;
            }
            if(gh.charAt(i)=='L'){
                secondPostion = i;
                break;
            }
        }

        if(gh.charAt(firstPostion) == 'R'){
        for (int i =0;i<gh.length();i++){

            if (gh.charAt(i)=='R'){
                secondPostion = i+1;
            }
        }
        if(gh.charAt(secondPostion)=='.')
        secondPostion++;
        }else{
        for (int i= gh.length()-1;i>=0;i--){
            if (gh.charAt(i)=='L'){
                firstPostion = i+1;
                break;
            }
        }
        }
        System.out.println(firstPostion);
        System.out.println(secondPostion);
        }

}


import javax.print.DocFlavor;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int ii = 0;
        int jj =0;
        int firstPostion = 0;
        int secondPosition = 0;
        int n = input.nextInt();
        int count = 0;
        String ghh = input.nextLine();
        String gh = input.nextLine();
        for (int i = 0;i<gh.length();i++){
            if (gh.charAt(i)=='L'){
                count++;
            }
        }
        for(int i = 0;i<gh.length();i++){
            if (gh.charAt(i) == 'R' || gh.charAt(i) == 'L'){
                ii = i;
                break;
            }
       }
        for (int j=gh.length()-1;j>=0;j--){
            if (gh.charAt(j)=='R'||gh.charAt(j)=='L'){
                jj=j;
                break;
            }
        }
       if (gh.charAt(ii)=='R' && gh.charAt(jj)=='R'){
            firstPostion = ii+1;
            secondPosition = jj+2;
        }
        if (gh.charAt(ii)=='L' && gh.charAt(jj)=='L'){
            firstPostion = jj+1;
            secondPosition = ii;
        }
        if(gh.charAt(ii)=='R'&&gh.charAt(jj)=='L'){
             firstPostion = ii+1;
             secondPosition = (jj-count)+1;
        }
        System.out.println(firstPostion);
       System.out.println(secondPosition);
    }
}


import javax.print.DocFlavor;
import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int firstPostionL =0;
        int firstPostion =0;
        int secondPostionl = 0;
        int secondPostion = 0;
        int n = input.nextInt();
        input.nextLine();
        String gh = input.nextLine();
        for (int i =0;i<gh.length();i++){
            if (gh.charAt(i)=='R'){
                firstPostion = i+1;
                break;
            }
            if(gh.charAt(i)=='L'){
                secondPostion = i;
                break;
            }
        }

        if(firstPostion != 0){
        for (int i =0;i<gh.length();i++){

            if (gh.charAt(i)=='R'){
                secondPostion = i+1;
            }
        }
        if(gh.charAt(secondPostion)=='.')
        secondPostion++;
        }else{
        for (int i= gh.length()-1;i>=0;i--){
            if (gh.charAt(i)=='L'){
                firstPostion = i+1;
                break;
            }
        }
        }
        System.out.println(firstPostion);
        System.out.println(secondPostion);
        }

}


هmport javax.print.DocFlavor;
import java.util.Arrays;
import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int ii = 0;
        int jj =0;
        int firstPostion = 0;
        int secondPosition = 0;
        int n = input.nextInt();
        int count = 0;
        String ghh = input.nextLine();
        String gh = input.nextLine();
        for (int i = 0;i<gh.length();i++){
            if (gh.charAt(i)=='L'){
                count++;
            }
        }
        for(int i = 0;i<gh.length();i++){
            if (gh.charAt(i) == 'R' || gh.charAt(i) == 'L'){
                ii = i;
                break;
            }
       }
        for (int j=gh.length()-1;j>=0;j--){
            if (gh.charAt(j)=='R'||gh.charAt(j)=='L'){
                jj=j;
                break;
            }
        }
       if (gh.charAt(ii)=='R' && gh.charAt(jj)=='R'){
            firstPostion = ii+1;
            secondPosition = jj+2;
        }
        if (gh.charAt(ii)=='L' && gh.charAt(jj)=='L'){
            firstPostion = jj+1;
            secondPosition = ii;
        }
        if(gh.charAt(ii)=='R'&&gh.charAt(jj)=='L'){
             firstPostion = ii+1;
             secondPosition = (jj-count)+1;
        }
        System.out.println(firstPostion);
       System.out.println(secondPosition);
    }
}


//package Div2A;

import java.util.Scanner;

public class SnowFootprints {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc= new Scanner(System.in);

		int n = sc.nextInt();
		String path= sc.next();

		int s = 0;
		String dir = "";

		for (int i = 0; i < n; i++) {
			if(path.charAt(i)=='R' || path.charAt(i)=='L') {
				s = i+1;
				break;
			}
			//if(path.charAt(i)=='R' || path.charAt(i)=='L')

		}
		for (int i = 0; i < n; i++) {

			if(path.charAt(i)=='R' || path.charAt(i)=='L') {
				dir+=path.charAt(i) + "";
			}

		}

		int t = s;
		System.out.println(dir);
		for (int i = 0; i < dir.length(); i++) {
			if(dir.charAt(i)=='R') t++;
			else
				t--;
		}

		System.out.println(s + " " + t);

	}

}


//package Div2A;

import java.util.Scanner;

public class SnowFootprints {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String path = sc.next();
		int fst = 0;
		int lst = 0;
		for (int i = 0; i < path.length(); i++) {
			if(path.charAt(i)!='.') {
				fst = i;
				break;
			}
		}
		for (int i = n-1; i >=0; i--) {
			if(path.charAt(i)!='.') {
				lst = i;
				break;
			}
		}

		//first case
		if(path.charAt(fst)=='R'&& path.charAt(lst)=='R') {
			fst++;
			lst+=2;
			System.out.println(fst + " " + lst);
		}
		else if(path.charAt(fst)=='L'&& path.charAt(lst)=='L') {
			lst++;
			//fst++;
			System.out.println(lst + " " + fst);
		}else {

			for (int i = 0; i < path.length(); i++) {
				if(path.charAt(i)=='L') lst = i-1;
			}
			fst++;
			lst++;
			System.out.println(fst + " " 6 lst);
		}

	}

}


//package Div2A;

import java.util.Scanner;

public class SnowFootprints {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String path = sc.next();
		int fst = 0;
		int lst = 0;
		for (int i = 0; i < path.length(); i++) {
			if(path.charAt(i)!='.') {
				fst = i;
				break;
			}
		}
		for (int i = n-1; i >=0; i--) {
			if(path.charAt(i)!='.') {
				lst = i;
				break;
			}
		}

		//first case
		if(path.charAt(fst)=='R'&& path.charAt(lst)=='R') {
			fst++;
			lst+=2;
			System.out.println(fst + " " + lst);
		}
		else if(path.charAt(fst)=='L'&& path.charAt(lst)=='L') {
			lst++;
			//fst++;
			System.out.println(lst + " " + fst);
		}else {

			for (int i = 0; i < path.length(); i++) {
				if(path.charAt(i)=='L') {
					lst = i-1;
					break;
				}

			}
			fst++;
			lst++;
			System.out.println(fst + " " + lst);
		}

	}

}


//package Div2A;

import java.util.Scanner;

public class SnowFootprints {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		String path = sc.next();
		int fst = 0;
		int lst = 0;
		for (int i = 0; i < path.length(); i++) {
			if(path.charAt(i)!='.') {
				fst = i;
				break;
			}
		}
		for (int i = n-1; i >=0; i--) {
			if(path.charAt(i)!='.') {
				lst = i;
				break;
			}
		}

		//first case
		if(path.charAt(fst)=='R'&& path.charAt(lst)=='R') {
			fst++;
			lst+=2;
			System.out.println(fst + " " + lst);
		}
		else if(path.charAt(fst)=='L'&& path.charAt(lst)=='L') {
			lst++;
			//fst++;
			System.out.println(lst + " " + fst);
		}else {

			for (int i = 0; i < path.length(); i++) {
				if(path.charAt(i)=='L') lst = i-1;
			}
			fst++;
			lst++;
			System.out.println(fst + " " + lst);
		}

	}

}


import java.util.Scanner;

public class Footprint {

    public static void main(String[] args) {

        Scanner keyboard = new Scanner(System.in);
        int length = keyboard.nextInt();
        keyboard.nextLine();
        String road = keyboard.nextLine();

        for (int i = 1; i <= length; i++) {

            if(road.charAt(i-1) == '.')
            {
                continue;
            }

            if(road.charAt(i-1) == 'R')
            {
                System.out.print(i + " ");
                while(road.charAt(i-1) == 'R')
                {
                    i++;
                }

                if(road.charAt(i-1) == 'L') {
                    System.out.println(i-1);
                }
                else
                {
                    System.out.println(i);

                }
                return;
            }

            if(road.charAt(i) == 'L')
            {
                int endPos = i-1;
                while(road.charAt(i-1) == 'L')
                {
                    i++;
                }

                System.out.println(i-1 + " " + endPos);
                return;
            }

        }

    }
}


import java.util.Scanner;

public class Footprint {

    public static void main(String[] args) {

        Scanner keyboard = new Scanner(System.in);
        int length = keyboard.nextInt();
        keyboard.nextLine();
        String road = keyboard.nextLine();

        for (int i = 1; i <= length; i++) {

            if(road.charAt(i-1) == '.')
            {
                continue;
            }

            if(road.charAt(i-1) == 'R')
            {
                System.out.print(i + " ");
                while(road.charAt(i-1) == 'R')
                {
                    i++;
                }

                if(road.charAt(i-1) == 'L') {
                    System.out.println(i-1);
                }
                else
                {
                    System.out.println(i);

                }
                return;
            }

            if(road.charAt(i) == 'L')
            {
                int endPos = i-1;
                while(road.charAt(i-1) == 'L')
                {
                    i++;
                }

                System.out.println(i + " " + endPos);
                return;
            }

        }

    }
}


import java.util.Scanner;

public class Footprint {

    public static void main(String[] args) {

        Scanner keyboard = new Scanner(System.in);
        int length = keyboard.nextInt();
        keyboard.nextLine();
        String road = keyboard.nextLine();

        for (int i = 0; i < length; i++) {

            if(road.charAt(i) == '.')
            {
                continue;
            }

            if(road.charAt(i) == 'R')
            {
                System.out.print((i+1) + " ");
                while(road.charAt(i) == 'R')
                {
                    i++;
                }

                System.out.println(i);
                return;
            }

            if(road.charAt(i) == 'L')
            {
                int endPos = i+1;
                while(road.charAt(i) == 'L')
                {
                    i++;
                }

                System.out.println( i + " " + endPos);
                return;
            }

        }

    }
}


import java.util.Scanner;

public class Footprint {

    public static void main(String[] args) {

        Scanner keyboard = new Scanner(System.in);
        int length = keyboard.nextInt();
        keyboard.nextLine();
        String road = keyboard.nextLine();

        for (int i = 1; i <= length; i++) {

            if(road.charAt(i-1) == '.')
            {
                continue;
            }

            if(road.charAt(i-1) == 'R')
            {
                System.out.print(i + " ");
                while(road.charAt(i-1) == 'R')
                {
                    i++;
                }

                if(road.charAt(i-1) == 'L') {
                    System.out.println(i-1);
                }
                else
                {
                    System.out.println(i);

                }
                return;
            }

            if(road.charAt(i-1) == 'L')
            {
                int endPos = i-1;
                while(road.charAt(i-1) == 'L')
                {
                    i++;
                }

                System.out.println(i-1 + " " + endPos);
                return;
            }

        }

    }
}


import java.util.Scanner;

public class Footprint {

    public static void main(String[] args) {

        Scanner keyboard = new Scanner(System.in);
        int length = keyboard.nextInt();
        keyboard.nextLine();
        String road = keyboard.nextLine();

        for (int i = 0; i < length; i++) {

            if(road.charAt(i) == '.')
            {
                continue;
            }

            if(road.charAt(i) == 'R')
            {
                System.out.print(i + " ");
                while(road.charAt(i) == 'R')
                {
                    i++;
                }

                System.out.println(i-1);
                return;
            }

            if(road.charAt(i) == 'L')
            {
                int endPos = i;
                while(road.charAt(i) == 'L')
                {
                    i++;
                }

                System.out.println( (i-1) + " " + endPos);
                return;
            }

        }

    }
}


import java.util.HashMap;
import java.util.Scanner;

/**
 *
 * @author Ahmed_Naser
 */
public class SnowFootprints {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
             Scanner in = new Scanner(System.in);

             int start = 0 , end = 0 ;

             int n = in.nextInt();
             String road = in.next();

          HashMap <Character , Integer> map = new HashMap();
             for (int i = 0; i < road.length(); i++)
             {

                 if(road.charAt(i) == 'R' || road.charAt(i) == 'L')
                 {
                     start = i + 1 ;
                     break;
                 }
             }

             for (int i = 0; i < road.length(); i++)
             {

                 if(road.charAt(i) != '.')
                 {
                   map.put(road.charAt(i), i+1);
                 }

             }

             if(map.size() == 1)
             {
                 if(map.get('R')!= null)
                 {
                     end = map.get('R') + 1 ;
                 }
                 else{
                       end = map.get('L') - 1 ;
                 }
             }
             else{
                 if(map.size() == 2)
                 {
                     end = map.get('R') ;
                 }
             }

             System.out.println(start +"  "+ end);

    }

}


import java.util.HashMap;
import java.util.Scanner;

/**
 *
 * @author Ahmed_Naser
 */
public class SnowFootprints {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
             Scanner in = new Scanner(System.in);

             int start = 0 , end = 0 ;

             int n = in.nextInt() , count = 0;
             String road = in.next();

          HashMap <Character , Integer> map = new HashMap();
             for (int i = 0; i < road.length(); i++)
             {

                 if(road.charAt(i) == 'R' || road.charAt(i) == 'L')
                 {
                     start = i + 1 ;
                     break;
                 }
             }

             for (int i = 0; i < road.length(); i++)
             {

                 if(road.charAt(i) != '.')
                 {
                     count++;
                   map.put(road.charAt(i), i+1);
                 }

             }

             if(map.size() == 1)
             {
                 if(map.get('R')!= null)
                 {
                     end = map.get('R') + 1 ;
                 }
                 else{
                       end = ((map.get('L')) - count);

                 }
             }
             else{
                 if(map.size() == 2)
                 {
                     end = map.get('R') ;
                 }
             }

             System.out.println(start +"  "+ end);

    }

}


import java.util.HashMap;
import java.util.Scanner;

/**
 *
 * @author Ahmed_Naser
 */
public class SnowFootprints {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
             Scanner in = new Scanner(System.in);

             int start = 0 , end = 0 ;

             int n = in.nextInt();
             String road = in.next();

          HashMap <Character , Integer> map = new HashMap();
             for (int i = 0; i < road.length(); i++)
             {

                 if(road.charAt(i) == 'R' || road.charAt(i) == 'L')
                 {
                     start = i + 1 ;
                     break;
                 }
             }

             for (int i = 0; i < road.length(); i++)
             {

                 if(road.charAt(i) != '.')
                 {
                   map.put(road.charAt(i), i+1);
                 }

             }

             if(map.size() == 1)
             {
                 if(map.get('R')!= null)
                 {
                     end = map.get('R') + 1 ;
                 }
                 else{
                       end = (map.get('L') - 1) - start ;

                 }
             }
             else{
                 if(map.size() == 2)
                 {
                     end = map.get('R') ;
                 }
             }

             System.out.println(start +"  "+ end);

    }

}


import java.util.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner in=new Scanner(System.in);
	    int n=in.nextInt();
	    String s=in.next();
	    int ss=0,t=0,i,j;
	    for(i=0;i<s.length();i++){
	        if(s.charAt(i)=='R'){
	            ss=i+1;
	            for(j=i;j<s.length();j++)
	                if(s.charAt(j)=='L' || s.charAt(j)=='.'){
	                    if(s.charAt(j)=='L')
	                        t=j;
	                    else
	                        t=j+1;
	                    break;
	                }
	                break;
	        }
	        else if(s.charAt(i)=='L'){
	            t=i;
	            for(j=i;j<s.length();j++)
	                if(s.charAt(j)=='.'){
	                   ss=j;
	                    break;
	                }
	                break;
	        }
	    }
	    System.out.println(ss+" "+t);
	}
}


import java.util.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner in=new Scanner(System.in);
	    int n=in.nextInt();
	    String s=in.next();
	    int ss=0,t=0,i,j;
	    for(i=0;i<s.length();i++)
	        if(s.charAt(i)=='R'){
	            ss=i+1;
	            break;
	        }
	    for(j=i;j<s.length();j++)
	        if(s.charAt(j)=='L'){
	            t=j;
	            break;
	        }
	    System.out.println(ss+" "+t);
	}
}


import java.util.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner in=new Scanner(System.in);
	    int n=in.nextInt();
	    String s=in.next();
	    int ss=0,t=0,i,j;
	    for(i=0;i<s.length();i++)
	        if(s.charAt(i)=='R'){
	            ss=i+1;
	            break;
	        }
	    for(j=i;j<s.length();j++)
	        if(s.charAt(j)=='L' || s.charAt(j)=='.'){
	            if(s.charAt(j)=='L')
	                t=j;
	            else
	                t=j+1;
	            break;
	        }
	    System.out.println(ss+" "+t);
	}
}


import java.util.Scanner;

public class CF298_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 2 min
        // implement time 4 min
        // debug 0 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        char[] arr = scanner.next().toCharArray();
        int start = -1;
        int end = n + 1;
        boolean r = false;
        for (int i = 0; i < n; i++) {
            if (arr[i] == 'R') {
                start = i;
                r = true;
                break;
            } else if (arr[i] == 'L') {
                start = i;
                break;
            }
        }
        for (int i = start; i < n; i++) {
            if (r) {
                if (arr[i] == 'L') {
                    end = i;
                    break;
                }
            } else {
                if (arr[i] == 'R') {
                    end = i;
                    break;
                }
            }
        }
        System.out.println((start + 1) + " " + (end - 1));
    }
}


import java.util.Scanner;

public class CF298_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 2 min
        // implement time 4 min
        // debug 0 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        char[] arr = scanner.next().toCharArray();
        int start = -1;
        int end = n + 1;
        boolean r = false;
        for (int i = 0; i < n; i++) {
            if (arr[i] == 'R') {
                start = i;
                r = true;
                break;
            } else if (arr[i] == 'L') {
                start = i;
                break;
            }
        }
        for (int i = start; i < n; i++) {
            if (r) {
                if (arr[i] == 'L') {
                    end = i;
                    break;
                }
            } else {
                if (arr[i] == 'R') {
                    end = i;
                    break;
                }
            }
        }
        System.out.println((start + 1) + " " + (end));
    }
}


import java.util.Scanner;

public class CF298_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 2 min
        // implement time 4 min
        // debug 0 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String s = scanner.next();
        char[] arr = s.toCharArray();
        int start = -1;
        int end = n + 1;
        boolean r = false;
        for (int i = 0; i < n; i++) {
            if (arr[i] == 'R') {
                start = i;
                r = true;
                break;
            } else if (arr[i] == 'L') {
                start = i;
                break;
            }
        }
        for (int i = start; i < n; i++) {
            if (r) {
                if (arr[i] == 'L') {
                    end = i;
                    break;
                }
                if (arr[i] == '.') {
                    end = i + 1;
                    break;
                }
            } else {
                if (arr[i] == 'R') {
                    end = i;
                    break;
                }
                if (arr[i] == '.') {
                    end = i - 1;
                    break;
                }
            }
        }
        if (!s.contains("R")) {
            System.out.println((end + 1) + " " + (start));
            return;
        }
        System.out.println((start + 1) + " " + (end));
    }
}


import java.util.Scanner;

public class CF298_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 2 min
        // implement time 4 min
        // debug 0 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String s = scanner.next();
        char[] arr = s.toCharArray();
        int start = -1;
        int end = n + 1;
        boolean r = false;
        for (int i = 0; i < n; i++) {
            if (arr[i] == 'R') {
                start = i;
                r = true;
                break;
            } else if (arr[i] == 'L') {
                start = i;
                break;
            }
        }
        for (int i = start; i < n; i++) {
            if (r) {
                if (arr[i] == 'L') {
                    end = i;
                    break;
                }
                if (arr[i] == '.') {
                    end = i - 1;
                    break;
                }
            } else {
                if (arr[i] == 'R') {
                    end = i;
                    break;
                }
                if (arr[i] == '.') {
                    end = i + 1;
                    break;
                }
            }
        }
        if (!s.contains("R")) {
            System.out.println((end - 1) + " " + (start));
            return;
        }
        System.out.println((start + 1) + " " + (end));
    }
}


import java.util.Scanner;

public class CF298_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 2 min
        // implement time 4 min
        // debug 0 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        char[] arr = scanner.next().toCharArray();
        int start = -1;
        int end = n + 1;
        boolean r = false;
        for (int i = 0; i < n; i++) {
            if (arr[i] == 'R') {
                start = i;
                r = true;
                break;
            } else if (arr[i] == 'L') {
                start = i;
                break;
            }
        }
        for (int i = start; i < n; i++) {
            if (r) {
                if (arr[i] == 'L') {
                    end = i;
                    break;
                }
                if (arr[i] == '.') {
                    end = i + 1;
                    break;
                }
            } else {
                if (arr[i] == 'R') {
                    end = i;
                    break;
                }
                if (arr[i] == '.') {
                    end = i - 1;
                    break;
                }
            }
        }
        System.out.println((start + 1) + " " + (end));
    }
}


import java.util.Scanner;

public class CF298_D2_A {
    public static void main(String[] args) {
        // time reading 4 min
        // think 2 min
        // implement time 4 min
        // debug 0 min
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        char[] arr = scanner.next().toCharArray();
        int start = -1;
        int end = n + 1;
        boolean r = false;
        for (int i = 0; i < n; i++) {
            if (arr[i] == 'R') {
                start = i;
                r = true;
                break;
            } else if (arr[i] == 'L') {
                start = i;
                break;
            }
        }
        for (int i = start; i < n; i++) {
            if (r) {
                if (arr[i] == 'L' || arr[i] == '.') {
                    end = i;
                    break;
                }
            } else {
                if (arr[i] == 'R' || arr[i] == '.') {
                    end = i;
                    break;
                }
            }
        }
        System.out.println((start + 1) + " " + (end));
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class A298 {

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt();

        String s = in.next();

        int start = s.indexOf("R");
        int end = 0;

        if (start != -1) {
            for (int i = start + 1; i < n; i++) {
                if (s.charAt(i) != 'R' ) {
                    end = i;
                    break;
                }
        }
        }
        else{

            start = s.lastIndexOf("L");
            for (int i = start; i >=0 ; i--) {
                if (s.charAt(i) != 'L') {
                    end = i;
                    break;
                }
            }
        }

        System.out.println( (start + 1) + " " + end  );

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class A298 {

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt();

        String s = in.next();

        int start = s.indexOf("R");
        int end = 0;

        if (start != -1) {
            for (int i = start + 1; i < n; i++) {
                if (s.charAt(i) != 'R' ) {
                    end = i;
                    break;
                }
        }
        }
        else{

            start = s.lastIndexOf("L");
            for (int i = start; i >=0 ; i--) {
                if (s.charAt(i) != 'L') {
                    end = i;
                    break;
                }
            }
        }

        System.out.println( (start + 1) + " " + (end + 1)  );

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class A298 {

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {

        FastReader in = new FastReader();

        int n = in.nextInt();

        String s = in.next();

        int start = s.indexOf("R");
        int end = 0;

        if (start != -1) {
            for (int i = start + 1; i < n; i++) {
                if (s.charAt(i) != 'R' ) {
                    end = i;
                    break;
                }
        }
        }
        else{

            start = s.lastIndexOf("L");
            for (int i = start; i >=0 ; i--) {
                if (s.charAt(i) != 'L') {
                    end = i - 1;
                    break;
                }
            }
        }

        System.out.println( (start + 1) + " " + (end + 1)  );

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;

public class Main3 {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s = br.readLine();
		int start = -1;
		int i =0;
		while(s.charAt(i)=='.'){
			i++;
		}
		start = i+1;
		boolean allr=true;
		boolean alll = true;
		int lr = -1;
		int ll = -1;
		int fl = -1;
		int fr = -1;
		for (int j = start-1; j < n; j++) {
			if(s.charAt(j)=='.'){
				break;
			}
			allr = allr && (s.charAt(j)=='R');
			alll = alll && (s.charAt(j)=='L');
			if(s.charAt(j)=='L'){
				ll = j+1;
			}
			if(s.charAt(j)=='R'){
				lr = j+1;
			}
		}
		if (alll) {
			i=0;
			while(s.charAt(i) !='L'){
				i++;
			}
			System.out.println(i+" "+(ll-1));
		}else{
			if (allr) {
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				System.out.println((i+1) +" "+(lr+1));
			}else{
				while(s.charAt(i) !='L'){
					i++;
				}
				fl=i;
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				fr=i;
				System.out.println(start+" "+(lr+1));

			}
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;

public class Main3 {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s = br.readLine();
		int start = -1;
		int i =0;
		while(s.charAt(i)=='.'){
			i++;
		}
		start = i+1;
		boolean allr=true;
		boolean alll = true;
		int lr = -1;
		int ll = -1;
		int fl = -1;
		int fr = -1;
		for (int j = start-1; j < n; j++) {
			if(s.charAt(j)=='.'){
				break;
			}
			allr = allr && (s.charAt(j)=='R');
			alll = alll && (s.charAt(j)=='L');
			if(s.charAt(j)=='L'){
				ll = j+1;
			}
			if(s.charAt(j)=='R'){
				lr = j+1;
			}
		}
		if (alll) {
			i=0;
			while(s.charAt(i) !='L'){
				i++;
			}
			System.out.println(i+" "+ll);
		}else{
			if (allr) {
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				System.out.println((i+1) +" "+lr);
			}else{
				while(s.charAt(i) !='L'){
					i++;
				}
				fl=i;
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				fr=i;
				System.out.println(start+" "+lr);

			}
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;

public class Main3 {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s = br.readLine();
		int start = -1;
		int i =0;
		while(s.charAt(i)=='.'){
			i++;
		}
		start = i+1;
		boolean allr=true;
		boolean alll = true;
		int lr = -1;
		int ll = -1;
		int fl = -1;
		int fr = -1;
		for (int j = start-1; j < n; j++) {
			if(s.charAt(j)=='.'){
				break;
			}
			allr = allr && (s.charAt(j)=='R');
			alll = alll && (s.charAt(j)=='L');
			if(s.charAt(j)=='L'){
				ll = j+1;
			}
			if(s.charAt(j)=='R'){
				lr = j+1;
			}
		}
		if (alll) {
			i=0;
			while(s.charAt(i) !='L'){
				i++;
			}
			System.out.println(ll+" "+i);
		}else{
			if (allr) {
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				System.out.println((i+1) +" "+(lr+1));
			}else{
				while(s.charAt(i) !='L'){
					i++;
				}
				fl=i;
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				fr=i;
				System.out.println(start+" "+(lr+1));

			}
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;

public class Main3 {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s = br.readLine();
		int start = -1;
		int i =0;
		while(s.charAt(i)=='.'){
			i++;
		}
		start = i+1;
		boolean allr=true;
		boolean alll = true;
		int lr = -1;
		int ll = -1;
		int fl = -1;
		int fr = -1;
		for (int j = 0; j < n; j++) {
			allr = allr && (s.charAt(j)=='R');
			alll = alll && (s.charAt(j)=='L');
			if(s.charAt(j)=='L'){
				ll = j+1;
			}
			if(s.charAt(j)=='R'){
				lr = j+1;
			}
		}
		if (alll) {
			i=0;
			while(s.charAt(i) !='L'){
				i++;
			}
			System.out.println(lr+" "+i);
		}else{
			if (allr) {
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				System.out.println(i +" "+lr);
			}else{
				while(s.charAt(i) !='L'){
					i++;
				}
				fl=i;
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				fr=i;
				System.out.println(start+" "+lr);

			}
		}

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;

public class Main3 {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String s = br.readLine();
		int start = -1;
		int i =0;
		while(s.charAt(i)=='.'){
			i++;
		}
		start = i+1;
		boolean allr=true;
		boolean alll = true;
		int lr = -1;
		int ll = -1;
		int fl = -1;
		int fr = -1;
		for (int j = start-1; j < n; j++) {
			if(s.charAt(j)=='.'){
				break;
			}
			allr = allr && (s.charAt(j)=='R');
			alll = alll && (s.charAt(j)=='L');
			if(s.charAt(j)=='L'){
				ll = j+1;
			}
			if(s.charAt(j)=='R'){
				lr = j+1;
			}
		}
		if (alll) {
			i=0;
			while(s.charAt(i) !='L'){
				i++;
			}
			System.out.println(lr+" "+i);
		}else{
			if (allr) {
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				System.out.println(i +" "+lr);
			}else{
				while(s.charAt(i) !='L'){
					i++;
				}
				fl=i;
				i=0;
				while(s.charAt(i) !='R'){
					i++;
				}
				fr=i;
				System.out.println(start+" "+lr);

			}
		}

	}

}


import java.util.Scanner;

public class SnowFootprints {

    public static void main(String[] args) {

        Scanner input = new Scanner (System.in);

        int n = input.nextInt();

        int start = -1, end = -1;

        String s = input.next();

        for (int i = 0 ; i < s.length() ; i++) {

            if(s.charAt(i) != '.' && start == -1)
                start = i;

            if(s.charAt(i) == '.' && start != -1 && end == -1)
                end = i-1;
        }

        //System.out.println(start + " " + end);

        if(s.charAt(start) == 'R' && s.charAt(end) == 'R')
            System.out.println((start+1) + " " + (end+2));
        else
            if(s.charAt(start) == 'L' && s.charAt(end) == 'L')
                System.out.println( (end+1) + " " + (start+2));
        else
            System.out.println((start+1) + " " + (s.indexOf("L")));
    }

}


import java.util.Scanner;

public class SnowFootprints {

    public static void main(String[] args) {

        Scanner input = new Scanner (System.in);

        int n = input.nextInt();

        int start = -1, end = -1;

        String s = input.next();

        for (int i = 0 ; i < s.length() ; i++) {

            if(s.charAt(i) != '.' && start == -1)
                start = i;

            if(s.charAt(i) == '.' && start != -1 && end == -1)
                end = i-1;
        }

        //System.out.println(start + " " + end);

        if(s.charAt(start) == 'R' && s.charAt(end) == 'R')
            System.out.println((start+1) + " " + (end+2));
        else
            if(s.charAt(start) == 'L' && s.charAt(end) == 'L')
                System.out.println( (end+1) + " " + (start));
        else
            System.out.println((start+1) + " " + (s.indexOf("L")));
    }

}


import java.util.Scanner;

public class SnowFootprints {

    public static void main(String[] args) {

        Scanner input = new Scanner (System.in);

        int n = input.nextInt();

        int start = -1, end = -1;

        String s = input.next();

        for (int i = 0 ; i < s.length() ; i++) {

            if(s.charAt(i) != '.' && start == -1)
                start = i;

            if(s.charAt(i) == '.' && start != -1 && end == -1)
                end = i-1;
        }

        System.out.println(start + " " + end);

        if(s.charAt(start) == 'R' && s.charAt(end) == 'R')
            System.out.println((start+1) + " " + (end+2));
        else
            if(s.charAt(start) == 'L' && s.charAt(end) == 'L')
                System.out.println( (end+1) + " " + (start));
        else
            System.out.println((start+1) + " " + (s.indexOf("L")));
    }

}


import java.util.Scanner;

public class MyClass {
    public static void main(String args[]) {
       Scanner scan = new Scanner(System.in);

       int n = scan.nextInt();
        scan.nextLine();
           char[] cmds = scan.nextLine().toCharArray();

           int l = 0 , r  = n-1;
           while(cmds[l]=='.'&&l+1<n)l++;
           while(cmds[r]=='.')r--;
           if(cmds[l]==cmds[r])
           {
            if(cmds[l]=='L')
            System.out.println(r+1 + " " + l );
            else{
                System.out.println(l+1+ " " + r+2);

            }

           }
           else {
            while (cmds[r]=='L')
                r--;

                System.out.println(l+1 + " "  + (r+1));
       }
    }
}


import java.util.Scanner;

public class MyClass {
    public static void main(String args[]) {
       Scanner scan = new Scanner(System.in);

       int n = scan.nextInt();
        scan.nextLine();
           char[] cmds = scan.nextLine().toCharArray();
           System.out.println(String.valueOf(cmds));
           int l = 0 , r  = n-1;
           while(cmds[l]=='.'&&l+1<n)l++;
           while(cmds[r]=='.')r--;
           if(cmds[l]==cmds[r])
           {
            if(cmds[l]=='L')
            System.out.println(r+1 + " " + l );
            else{
                System.out.println(l+1+ " " + r+2);

            }

           }
           else {
            while (cmds[r]=='L')
                r--;

                System.out.println(l+1 + " "  + (r+1));
       }
    }
}


import java.util.Scanner;

public class MyClass {
    public static void main(String args[]) {
       Scanner scan = new Scanner(System.in);

       int n = scan.nextInt();
        scan.nextLine();
           char[] cmds = scan.nextLine().toCharArray();

           int l = 0 , r  = n-1;
           while(cmds[l]=='.'&&l+1<n)l++;
           while(cmds[r]=='.'&&r>0)r--;
           if(cmds[l]==cmds[r])
           {
            if(cmds[l]=='L')
            System.out.println((r+1) + " " + l );
            else{
                System.out.println((l+1)+ " " + (r+2));

            }

           }
           else {
            while (cmds[r]=='L'&&r>0)
                r--;

                System.out.println((l+1) + " "  + (r+1));
       }
    }
}


import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Timur
 * 17:34  30.04.2018
 */
public class cf {
    private static final int MODULE = 1_000_000_007;
    private static Scanner sc = new Scanner(System.in);

    private static int min(int a, int b) {
        return a > b ? b : a;
    }

    private static int min(int[] a) {
        int min = Integer.MAX_VALUE;
        for (int i : a) {
            min = min > i ? i : min;
        }
        return min;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for (int i : a) {
            max = max < i ? i : max;
        }
        return max;
    }

    private static void in(int[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
    }

    private static void in(long[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextLong();
        }
    }

    private static void out(int[] a) {
        for (int i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[] a) {
        for (long i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[][] a) {
        for (long[] i : a) {
            out(i);
        }
    }

    private static boolean nextTransmutate(int[] arr) {
        int i = arr.length - 2;
        for (; i >= 0; i--) {
            if (arr[i] < arr[i + 1]) {
                break;
            }
        }
        if (i == -1)
            return false;
        for (int j = i + 1, k = arr.length - 1; j < k; j++, k--) {
            int temp = arr[j];
            arr[j] = arr[k];
            arr[k] = temp;
        }
        int j = i + 1;
        while (arr[j] < arr[i]) {
            j++;
        }
        int temp = arr[j];
        arr[j] = arr[i];
        arr[i] = temp;
        return true;
    }

    private static long[][] mul(long arr[][], long arr1[][]) {
        long[][] ans = new long[arr.length][arr.length];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                for (int k = 0; k < arr.length; k++) {
                    ans[i][j] += arr[i][k] * arr1[k][j];
                }
            }
        }
        return ans;
    }

    private static long[][] pow(long[][] a, int p) {
        long[][] res = new long[a.length][a.length];
        for (int i = 0; i < a.length; i++) {
            res[i][i] = 1;
        }
        while (p > 0)
            if (p % 2 == 1) {
                res = mul(res, a);
                p--;
            } else {
                a = mul(a, a);
                p /= 2;
            }
        return res;
    }

    public static void main(String[] args) throws FileNotFoundException {
        int n = sc.nextInt();
        String s = sc.next();
        int first = 0;
        int second = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '.' && first == 0) {
                if (s.charAt(i + 1) == 'R') {
                    first = i + 2;
                }
            }
            if (s.charAt(i) == 'R' && second == 0) {
                if (s.charAt(i + 1) == 'L') {
                    second = i+1;
                }
            }
        }
        System.out.println(first + " " + second);
    }
}


import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Timur
 * 17:34  30.04.2018
 */
public class cf {
    private static final int MODULE = 1_000_000_007;
    private static Scanner sc = new Scanner(System.in);

    private static int min(int a, int b) {
        return a > b ? b : a;
    }

    private static int min(int[] a) {
        int min = Integer.MAX_VALUE;
        for (int i : a) {
            min = min > i ? i : min;
        }
        return min;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for (int i : a) {
            max = max < i ? i : max;
        }
        return max;
    }

    private static void in(int[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
    }

    private static void in(long[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextLong();
        }
    }

    private static void out(int[] a) {
        for (int i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[] a) {
        for (long i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[][] a) {
        for (long[] i : a) {
            out(i);
        }
    }

    private static boolean nextTransmutate(int[] arr) {
        int i = arr.length - 2;
        for (; i >= 0; i--) {
            if (arr[i] < arr[i + 1]) {
                break;
            }
        }
        if (i == -1)
            return false;
        for (int j = i + 1, k = arr.length - 1; j < k; j++, k--) {
            int temp = arr[j];
            arr[j] = arr[k];
            arr[k] = temp;
        }
        int j = i + 1;
        while (arr[j] < arr[i]) {
            j++;
        }
        int temp = arr[j];
        arr[j] = arr[i];
        arr[i] = temp;
        return true;
    }

    private static long[][] mul(long arr[][], long arr1[][]) {
        long[][] ans = new long[arr.length][arr.length];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                for (int k = 0; k < arr.length; k++) {
                    ans[i][j] += arr[i][k] * arr1[k][j];
                }
            }
        }
        return ans;
    }

    private static long[][] pow(long[][] a, int p) {
        long[][] res = new long[a.length][a.length];
        for (int i = 0; i < a.length; i++) {
            res[i][i] = 1;
        }
        while (p > 0)
            if (p % 2 == 1) {
                res = mul(res, a);
                p--;
            } else {
                a = mul(a, a);
                p /= 2;
            }
        return res;
    }

    public static void main(String[] args) throws FileNotFoundException {
        int n = sc.nextInt();
        String s = sc.next();
        int first = 0;
        int second = 0;
        if (s.contains("R")) {
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == '.' && first == 0) {
                    if (s.charAt(i + 1) == 'R') {
                        first = i + 2;
                    }
                }
                if (s.charAt(i) == 'R' && second == 0) {
                    if (s.charAt(i + 1) == '.') {
                        second = i + 2;
                    }
                    if (s.charAt(i + 1) == 'L') {
                        second = i + 1;
                    }
                }
            }
            System.out.println(first + " " + second);
        } else {
            first = s.length() - 1;
            second = s.length() - 1;
            for (int i = s.length() - 1; i >= 0; i--) {
                if (s.charAt(i) == '.' && first == s.length() - 1) {
                    if (s.charAt(i - 1) == 'L') {
                        first = i;
                    }
                }
                if (s.charAt(i) == 'L' && second == s.length() - 1) {
                    if (s.charAt(i - 1) == 'R') {
                        second = i + 1;
                    }
                    if (s.charAt(i - 1) == '.') {
                        second = i;
                    }
                }
            }
            System.out.println(first + " " + second);
        }
    }
}


import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Timur
 * 17:34  30.04.2018
 */
public class cf {
    private static final int MODULE = 1_000_000_007;
    private static Scanner sc = new Scanner(System.in);

    private static int min(int a, int b) {
        return a > b ? b : a;
    }

    private static int min(int[] a) {
        int min = Integer.MAX_VALUE;
        for (int i : a) {
            min = min > i ? i : min;
        }
        return min;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for (int i : a) {
            max = max < i ? i : max;
        }
        return max;
    }

    private static void in(int[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
    }

    private static void in(long[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextLong();
        }
    }

    private static void out(int[] a) {
        for (int i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[] a) {
        for (long i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[][] a) {
        for (long[] i : a) {
            out(i);
        }
    }

    private static boolean nextTransmutate(int[] arr) {
        int i = arr.length - 2;
        for (; i >= 0; i--) {
            if (arr[i] < arr[i + 1]) {
                break;
            }
        }
        if (i == -1)
            return false;
        for (int j = i + 1, k = arr.length - 1; j < k; j++, k--) {
            int temp = arr[j];
            arr[j] = arr[k];
            arr[k] = temp;
        }
        int j = i + 1;
        while (arr[j] < arr[i]) {
            j++;
        }
        int temp = arr[j];
        arr[j] = arr[i];
        arr[i] = temp;
        return true;
    }

    private static long[][] mul(long arr[][], long arr1[][]) {
        long[][] ans = new long[arr.length][arr.length];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                for (int k = 0; k < arr.length; k++) {
                    ans[i][j] += arr[i][k] * arr1[k][j];
                }
            }
        }
        return ans;
    }

    private static long[][] pow(long[][] a, int p) {
        long[][] res = new long[a.length][a.length];
        for (int i = 0; i < a.length; i++) {
            res[i][i] = 1;
        }
        while (p > 0)
            if (p % 2 == 1) {
                res = mul(res, a);
                p--;
            } else {
                a = mul(a, a);
                p /= 2;
            }
        return res;
    }

    public static void main(String[] args) throws FileNotFoundException {
        int n = sc.nextInt();
        String s = sc.next();
        int first = 0;
        int second = 0;
        if (s.contains("R")) {
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == '.' && first == 0) {
                    if (s.charAt(i + 1) == 'R') {
                        first = i + 2;
                    }
                }
                if (s.charAt(i) == 'R' && second == 0) {
                    if (s.charAt(i + 1) == '.') {
                        second = i + 2;
                    }
                    if (s.charAt(i + 1) == 'L') {
                        second = i + 1;
                    }
                }
            }
            System.out.println(first + " " + second);
        } else {
            first = s.length() - 1;
            second = s.length() - 1;
            for (int i = s.length() - 1; i >= 0; i--) {
                if (s.charAt(i) == '.' && first == s.length() - 1) {
                    if (s.charAt(i - 1) == 'L') {
                        first = i - 2;
                    }
                }
                if (s.charAt(i) == 'L' && second == 0) {
                    if (s.charAt(i - 1) == 'R') {
                        second = i - 1;
                    }
                    if (s.charAt(i - 1) == '.') {
                        second = i - 2;
                    }
                }
            }
            System.out.println(first + " " + second);
        }
    }
}


import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Timur
 * 17:34  30.04.2018
 */
public class cf {
    private static final int MODULE = 1_000_000_007;
    private static Scanner sc = new Scanner(System.in);

    private static int min(int a, int b) {
        return a > b ? b : a;
    }

    private static int min(int[] a) {
        int min = Integer.MAX_VALUE;
        for (int i : a) {
            min = min > i ? i : min;
        }
        return min;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for (int i : a) {
            max = max < i ? i : max;
        }
        return max;
    }

    private static void in(int[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
    }

    private static void in(long[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextLong();
        }
    }

    private static void out(int[] a) {
        for (int i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[] a) {
        for (long i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[][] a) {
        for (long[] i : a) {
            out(i);
        }
    }

    private static boolean nextTransmutate(int[] arr) {
        int i = arr.length - 2;
        for (; i >= 0; i--) {
            if (arr[i] < arr[i + 1]) {
                break;
            }
        }
        if (i == -1)
            return false;
        for (int j = i + 1, k = arr.length - 1; j < k; j++, k--) {
            int temp = arr[j];
            arr[j] = arr[k];
            arr[k] = temp;
        }
        int j = i + 1;
        while (arr[j] < arr[i]) {
            j++;
        }
        int temp = arr[j];
        arr[j] = arr[i];
        arr[i] = temp;
        return true;
    }

    private static long[][] mul(long arr[][], long arr1[][]) {
        long[][] ans = new long[arr.length][arr.length];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                for (int k = 0; k < arr.length; k++) {
                    ans[i][j] += arr[i][k] * arr1[k][j];
                }
            }
        }
        return ans;
    }

    private static long[][] pow(long[][] a, int p) {
        long[][] res = new long[a.length][a.length];
        for (int i = 0; i < a.length; i++) {
            res[i][i] = 1;
        }
        while (p > 0)
            if (p % 2 == 1) {
                res = mul(res, a);
                p--;
            } else {
                a = mul(a, a);
                p /= 2;
            }
        return res;
    }

    public static void main(String[] args) throws FileNotFoundException {
        int n = sc.nextInt();
        String s = sc.next();
        int first = -1;
        int second = -1;
        if (s.contains("R")) {
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == '.' && first == -1) {
                    if (s.charAt(i + 1) == 'R') {
                        first = i + 2;
                    }
                }
                if (s.charAt(i) == 'R' && second ==-1) {
                    if (s.charAt(i + 1) == '.') {
                        second = i + 2;
                    }
                    if (s.charAt(i + 1) == 'L') {
                        second = i + 1;
                    }
                }
            }
            System.out.println(first + " " + second);
        } else {
            first = - 1;
            second =  - 1;
            for (int i = s.length() - 1; i >= 0; i--) {
                if (s.charAt(i) == '.' && first == - 1) {
                    if (s.charAt(i - 1) == 'L') {
                        first = i;
                    }
                }
                if (s.charAt(i) == 'L' && second == - 1) {
                    if (s.charAt(i - 1) == 'R') {
                        second = i + 1;
                    }
                    if (s.charAt(i - 1) == '.') {
                        second = i;
                    }
                }
            }
            System.out.println(first + " " + second);
        }
    }
}


import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * Timur
 * 17:34  30.04.2018
 */
public class cf {
    private static final int MODULE = 1_000_000_007;
    private static Scanner sc = new Scanner(System.in);

    private static int min(int a, int b) {
        return a > b ? b : a;
    }

    private static int min(int[] a) {
        int min = Integer.MAX_VALUE;
        for (int i : a) {
            min = min > i ? i : min;
        }
        return min;
    }

    private static int max(int a, int b) {
        return a > b ? a : b;
    }

    private static int max(int[] a) {
        int max = Integer.MIN_VALUE;
        for (int i : a) {
            max = max < i ? i : max;
        }
        return max;
    }

    private static void in(int[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextInt();
        }
    }

    private static void in(long[] a) {
        for (int i = 0; i < a.length; i++) {
            a[i] = sc.nextLong();
        }
    }

    private static void out(int[] a) {
        for (int i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[] a) {
        for (long i : a) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    private static void out(long[][] a) {
        for (long[] i : a) {
            out(i);
        }
    }

    private static boolean nextTransmutate(int[] arr) {
        int i = arr.length - 2;
        for (; i >= 0; i--) {
            if (arr[i] < arr[i + 1]) {
                break;
            }
        }
        if (i == -1)
            return false;
        for (int j = i + 1, k = arr.length - 1; j < k; j++, k--) {
            int temp = arr[j];
            arr[j] = arr[k];
            arr[k] = temp;
        }
        int j = i + 1;
        while (arr[j] < arr[i]) {
            j++;
        }
        int temp = arr[j];
        arr[j] = arr[i];
        arr[i] = temp;
        return true;
    }

    private static long[][] mul(long arr[][], long arr1[][]) {
        long[][] ans = new long[arr.length][arr.length];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                for (int k = 0; k < arr.length; k++) {
                    ans[i][j] += arr[i][k] * arr1[k][j];
                }
            }
        }
        return ans;
    }

    private static long[][] pow(long[][] a, int p) {
        long[][] res = new long[a.length][a.length];
        for (int i = 0; i < a.length; i++) {
            res[i][i] = 1;
        }
        while (p > 0)
            if (p % 2 == 1) {
                res = mul(res, a);
                p--;
            } else {
                a = mul(a, a);
                p /= 2;
            }
        return res;
    }

    public static void main(String[] args) throws FileNotFoundException {
        int n = sc.nextInt();
        String s = sc.next();
        int first = 0;
        int second = 0;
        if (s.contains("R")) {
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) == '.' && first == 0) {
                    if (s.charAt(i + 1) == 'R') {
                        first = i + 2;
                    }
                }
                if (s.charAt(i) == 'R' && second == 0) {
                    if (s.charAt(i + 1) == '.') {
                        second = i + 2;
                    }
                    if (s.charAt(i + 1) == 'L') {
                        second = i + 1;
                    }
                }
            }
            System.out.println(first + " " + second);
        } else {
            first = s.length() - 1;
            second = s.length() - 1;
            for (int i = s.length() - 1; i >= 0; i--) {
                if (s.charAt(i) == '.' && first == s.length() - 1) {
                    if (s.charAt(i - 1) == 'L') {
                        first = i - 2;
                    }
                }
                if (s.charAt(i) == 'L' && second == 0) {
                    if (s.charAt(i - 1) == 'R') {
                        second = i - 1;
                    }
                    if (s.charAt(i - 1) == '.') {
                        second = i - 2;
                    }
                }
            }
            System.out.println(second + " " + first);
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
    static Main.MyScanner sc = new Main.MyScanner();
    // static Main.Parser sc = new Parser(System.in);
    static PrintWriter out = new PrintWriter(System.out, true);

    public static void main(String[] args) throws Exception {
        int n = sc.nextInt(),s = -1,t = -1;
        String arr = "."+sc.next()+".";
        n = arr.length();
        for(int i = 0 ; i < n ; i++){
            if(arr.charAt(i) == 'L' && s == -1 )
                break;
            if( arr.charAt(i) == 'L'){
                t = i-1;
                break;
            }
            if(arr.charAt(i) == '.' && s != -1){
                t = i;
                break;
            }
            if(arr.charAt(i) == 'R' && s == -1){
                s = i;
            }
        }
        if(s == -1){
            for(int i = n-1 ; i >= 0 ; i--){
                if(arr.charAt(i) == 'L' && s == -1){
                    s = i;
                }
                if(arr.charAt(i) == '.' && s != -1){
                    t = i-1;
                    break;
                }
            }
        }
        out.print(s+" "+t);
        out.close();
    }

    static private class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public int mod(long x) {
            return (int) x % 1000000007;
        }

        public int mod(int x) {
            return x % 1000000007;
        }

        boolean hasNext() {
            if (st.hasMoreElements())
                return true;
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.hasMoreTokens();
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }

    static class Parser {
        final private int BUFFER_SIZE = 65536; // 2^16, a good compromise for
                                                // some problems
        private InputStream din; // Underlying input stream
        private byte[] buffer; // Self-maintained buffer
        private int bufferPointer; // Current read position in the buffer
        private int bytesRead; // Effective bytes in the buffer read from the
                                // input stream

        public Parser(InputStream in) {
            din = in;
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        /**
         * Read the next integer from the input stream.
         *
         * @return The next integer.
         * @throws IOException
         */
        public int nextInt() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
            if (neg)
                return -result;
            return result;
        }

        /**
         * Read the next byte of data from the input stream.
         *
         * @return the next byte of data, or -1 if the end of the stream is
         *         reached.
         * @throws IOException
         *             if an I/O error occurs.
         */
        public byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        /**
         * Read data from the input stream into the buffer
         *
         * @throws IOException
         *             if an I/O error occurs.
         */
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
    static Main.MyScanner sc = new Main.MyScanner();
    // static Main.Parser sc = new Parser(System.in);
    static PrintWriter out = new PrintWriter(System.out, true);

    public static void main(String[] args) throws Exception {
        int n = sc.nextInt(),s = -1,t = -1;
        String arr = "."+sc.next()+".";
        n = arr.length();
        for(int i = 0 ; i < n ; i++){
            if(arr.charAt(i) == 'L' && s == -1 )
                break;
            if( arr.charAt(i) == 'L'){
                t = i-1;
                break;
            }
            if(arr.charAt(i) == 'R' && s == -1){
                s = i;
            }
        }
        if(s == -1){
            for(int i = n-1 ; i >= 0 ; i--){
                if(arr.charAt(i) == 'L' && s == -1){
                    s = i;
                }
                if(arr.charAt(i) == '.' && s != -1){
                    t = i-1;
                    break;
                }
            }
        }
        out.print(s+" "+t);
        out.close();
    }

    static private class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public int mod(long x) {
            return (int) x % 1000000007;
        }

        public int mod(int x) {
            return x % 1000000007;
        }

        boolean hasNext() {
            if (st.hasMoreElements())
                return true;
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.hasMoreTokens();
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }

    static class Parser {
        final private int BUFFER_SIZE = 65536; // 2^16, a good compromise for
                                                // some problems
        private InputStream din; // Underlying input stream
        private byte[] buffer; // Self-maintained buffer
        private int bufferPointer; // Current read position in the buffer
        private int bytesRead; // Effective bytes in the buffer read from the
                                // input stream

        public Parser(InputStream in) {
            din = in;
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        /**
         * Read the next integer from the input stream.
         *
         * @return The next integer.
         * @throws IOException
         */
        public int nextInt() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
            if (neg)
                return -result;
            return result;
        }

        /**
         * Read the next byte of data from the input stream.
         *
         * @return the next byte of data, or -1 if the end of the stream is
         *         reached.
         * @throws IOException
         *             if an I/O error occurs.
         */
        public byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        /**
         * Read data from the input stream into the buffer
         *
         * @throws IOException
         *             if an I/O error occurs.
         */
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Set;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
    static Main.MyScanner sc = new Main.MyScanner();
    // static Main.Parser sc = new Parser(System.in);
    static PrintWriter out = new PrintWriter(System.out, true);

    public static void main(String[] args) throws Exception {
        int n = sc.nextInt(),s = -1,t = -1;
        String arr = "."+sc.next()+".";
        n = arr.length();
        for(int i = 0 ; i < n ; i++){
            if(arr.charAt(i) == 'L' && s == -1 )
                break;
            if( arr.charAt(i) != 'L'){
                t = i-1;
                break;
            }
            if(arr.charAt(i) == 'R' && s == -1){
                s = i;
            }
        }
        if(s == -1){
            for(int i = n-1 ; i >= 0 ; i--){
                if(arr.charAt(i) == 'L' && s == -1){
                    s = i;
                }
                if(arr.charAt(i) == '.' && s != -1){
                    t = i-1;
                    break;
                }
            }
        }
        out.print(s+" "+t);
        out.close();
    }

    static private class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public int mod(long x) {
            return (int) x % 1000000007;
        }

        public int mod(int x) {
            return x % 1000000007;
        }

        boolean hasNext() {
            if (st.hasMoreElements())
                return true;
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            return st.hasMoreTokens();
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }

    static class Parser {
        final private int BUFFER_SIZE = 65536; // 2^16, a good compromise for
                                                // some problems
        private InputStream din; // Underlying input stream
        private byte[] buffer; // Self-maintained buffer
        private int bufferPointer; // Current read position in the buffer
        private int bytesRead; // Effective bytes in the buffer read from the
                                // input stream

        public Parser(InputStream in) {
            din = in;
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        /**
         * Read the next integer from the input stream.
         *
         * @return The next integer.
         * @throws IOException
         */
        public int nextInt() throws IOException {
            int result = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            while (c >= '0' && c <= '9') {
                result = result * 10 + c - '0';
                c = read();
            }
            if (neg)
                return -result;
            return result;
        }

        /**
         * Read the next byte of data from the input stream.
         *
         * @return the next byte of data, or -1 if the end of the stream is
         *         reached.
         * @throws IOException
         *             if an I/O error occurs.
         */
        public byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        /**
         * Read data from the input stream into the buffer
         *
         * @throws IOException
         *             if an I/O error occurs.
         */
        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
    }
}