Santa Claus has Robot which lives on the infinite grid and can move along its lines. He can also, having a sequence of m points p1, p2, ..., pm with integer coordinates, do the following: denote its initial location by p0. First, the robot will move from p0 to p1 along one of the shortest paths between them (please notice that since the robot moves only along the grid lines, there can be several shortest paths). Then, after it reaches p1, it'll move to p2, again, choosing one of the shortest ways, then to p3, and so on, until he has visited all points in the given order. Some of the points in the sequence may coincide, in that case Robot will visit that point several times according to the sequence order.

While Santa was away, someone gave a sequence of points to Robot. This sequence is now lost, but Robot saved the protocol of its unit movements. Please, find the minimum possible length of the sequence.

Input

The first line of input contains the only positive integer n (1 ≤ n ≤ 2·105) which equals the number of unit segments the robot traveled. The second line contains the movements protocol, which consists of n letters, each being equal either L, or R, or U, or D. k-th letter stands for the direction which Robot traveled the k-th unit segment in: L means that it moved to the left, R — to the right, U — to the top and D — to the bottom. Have a look at the illustrations for better explanation.

Output

The only line of input should contain the minimum possible length of the sequence.

Examples

Input

4
RURD


Output

2


Input

6
RRULDD


Output

2


Input

26
RRRULURURUULULLLDLDDRDRDLD


Output

7


Input

3
RLL


Output

2


Input

4
LRLR


Output

4

Note

The illustrations to the first three tests are given below.

<image> <image> <image>

The last example illustrates that each point in the sequence should be counted as many times as it is presented in the sequence.
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main
{
	static class InputReader{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
 
		public InputReader(InputStream stream) {
			this.stream = stream;
		}
 
		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
 
		public int readInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}
 
		public String readString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}
 
		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
 
		public String next() {
			return readString();
		}
 
		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}
	
 
static class OutputWriter {
		private final PrintWriter writer;
 
		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}
 
		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}
 
		public void print(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}
 
		public void printLine(Object...objects) {
			print(objects);
			writer.println();
		}
 
		public void close() {
			writer.close();
		}
 
		public void flush() {
			writer.flush();
		}
 
		}
 
    static class IOUtils {
 
		public static int[] readIntArray(InputReader in, int size) {
			int[] array = new int[size];
			for (int i = 0; i < size; i++)
				array[i] = in.readInt();
			return array;
		}
    }
    static int n, m;
    static OutputWriter out;
    static InputReader in;
    static boolean[] a;
    static Integer[][] b;
    static HashSet<Integer> set;
    static char[] c;
    public static void main (String[] args) throws java.lang.Exception
	{
	    out = new OutputWriter(System.out);
		in = new InputReader(System.in);
		n = in.readInt();
        c = in.readString().toCharArray();
        int sum1 = 0; int sum2 = 0;
        int psum1 = 0; int psum2 = 0;
        int k = 0;
        for(int i=0; i<n; i++){
            if(c[i]=='R')sum1++;
            else if(c[i]=='U')sum2++;
            else if(c[i]=='L')sum1--;
            else if(c[i]=='D')sum2--;
            if(Math.abs(sum1)+Math.abs(sum2)>=Math.abs(psum1)+Math.abs(psum2)){psum1 = sum1; psum2 = sum2;}
            else{k++; sum1-=psum1; sum2-=psum2; psum1=sum1; psum2 =sum2;}
            //out.printLine(sum1 + " " + sum2 + " "+psum1 + " " + psum2 );
        }
        out.print(++k);
        out.flush();
        out.close();
	}
	
	public static boolean function(int l, int r){
	    l+=n-1; r+=n-1;
	    while(l<r){
	        if(l%2==1){
	            if(!a[l++])return false;
	        }
	        if(r%2==1){
	            if(!a[--r])return false;
	        }
	        l=l/2; r=r/2;
	    }
	    return true;
	    
	}
	public static boolean function(int i){
	    if(c[i]+c[i+1]+c[i+2]==3*'y' && (c[i]+c[i+1]!=2*'y'))return true;
	    return false;
	}
    public static int gcd(int a, int b){
        //b is greater
        if(a>b){int temp = a; a = b; b = temp;}
        if(b%a==0)return a;
        return gcd(b%a, a);
    }
	public static void add(int index, int value, int[] b){
	    while(index < b.length){
	        b[index] += value;
	        index = index + (index & (-index));
	    }
	}
	
	public static int getSum(int index, int [] b){
	    int sum = 0;
	    while(index > 0){
	        sum += b[index];
	        index = index - (index&(-index));
	    }
	    return sum;
	}
	
	public static void printArray(int[] a){
	    for(int i=1; i<a.length; i++)out.print(a[i]+" ");
	    out.printLine("---------");
	}
	
	static class Pair implements Comparable<Pair>{
	    int s;
	    //int d;
	    int len;
	    public Pair(int a, int c){
	        s = a; len = c;
	    }
	    public int compareTo(Pair p){
	        if(this.len > p.len)return 1;
	        else if(this.len < p.len)return -1;
	        return 0;
	    }
	}
}