using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace plazmaaa
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int n, q,mali=0;
            string[]s=Console.ReadLine().Split(' ');
            n=int.Parse(s[0]);
            q=int.Parse(s[1]);
            int br = 0;
            int[,] mat=new int[n+1,2];
            for(int i=0; i<n; i++)
            {
                s=Console.ReadLine().Split(' ');
                mat[i,0]=int.Parse(s[0]);
                mat[i,1]=int.Parse(s[1]);
            }
                int gr=int.Parse(Console.ReadLine());
                mat[n, 0] = gr; mat[n, 1] = 0;
                for (int j=0;j<n; j++)
                {
                    if(mat[j,0]>=gr)
                    {
                        break;
                    }
                    if(mat[j+1,0]>=gr)
                    {
                        mat[j+1, 0] = gr;
                    }
                    if(mat[j,0]+mat[j,1]-1<=mat[j+1,0])
                    {
                        br = br + mat[j, 1];
                    }
                    else
                    {
                        br = br + mat[j+1,0]-mat[j,0]+1;
                        mat[j + 1, 1]+= mat[j, 1] - (mat[j + 1, 0] - mat[j, 0] + 1);
                    mali++;
                    
                    }
                }
            if(mali>0)
            {
                Console.WriteLine(br - mali + 1);
            }
            else
            {
                Console.WriteLine(br);
            }
        }
    }
}