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

namespace ConsoleApplication71
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int c = int.Parse(s[1]);
            int q = int.Parse(s[2]);
            int b1 = 0;
            long s1 = long.Parse(Console.ReadLine());
            long[] a = new long[n];
            long stepen = (long)Math.Pow(10, n - 1);
            for (int i = 0; i < n; i++)
            {
                a[i] = (s1 / stepen) % 10;
                if (a[i] == 0) b1++;
                stepen /= 10;
            }
            if (c == n)
            {
                for (int i = 0; i < q; i++)
                {
                    s = Console.ReadLine().Split();
                    int l = int.Parse(s[0]);
                    int d = int.Parse(s[1]);
                    for (int j = l; j <= d; j++)
                    {
                        a[j] = (a[j] + 1) % 2;
                        if (a[j] == 1) b1++;
                        else b1--;
                    }
                    Console.WriteLine(b1);
                }
            }
            else
            {
                for (int i = 0; i < n; i++)
                {
                    s = Console.ReadLine().Split();
                    int l = int.Parse(s[0]);
                    int d = int.Parse(s[1]);
                    int r = 0;
                    int p = (int)a[0];
                    bool t = false;
                    for (i = 1; i < n; i++) 
                    {
                        if (i >= l && i <= d) a[i] = (a[i] + 1) % 2;
                        if (a[i] == 1) t = true;
                        else t = false;
                        if (t) 
                        {
                            r++;
                        }
                        else
                        {
                            if(r>=c)
                            {
                                b1 += c;
                            }
                            else
                            {
                                b1 += r;
                            }
                            r = 0;
                        }
                    }
                }
                Console.WriteLine(b1);
            }
        }
    }
}