using System;
using System.Text;


namespace ConsoleApp2
{
    class Program
    {
        static void promenaNiz(ref string s, int l1, int r1)
        {
            int i = 0;
            StringBuilder sb = new StringBuilder(s);
            for(i=l1;i<=r1;i++)
            {
                if (sb[i] == '0')
                {
                    sb[i] = '1';
                }
                else
                    sb[i] = '0';
            }
            s = sb.ToString();
        }
        static void brojke(string s,ref int min0, ref int min1, ref int max0, ref int max1, ref int br0, ref int br1,ref int[] nule,ref int[] jedinice)
        {
            int i, flag0 = 0, flag1 = 0;
            for (i = 0; i < s.Length; i++)
            {
                if (s[i] == '0')
                {
                    if (min0 == 0 && flag0 == 0)
                    {
                        min0 = i;
                        flag0 = 1;
                    }
                    nule[i] = 1;
                    max0 = i;
                    br0++;
                }
                else
                {
                    if (min1 == 0 && flag1 == 0)
                    {
                        min1 = i;
                        flag1 = 1;
                    }
                    jedinice[i] = 1;
                    br1++;
                    max1 = i;
                }
            }
        }
        static void reset(ref int min0, ref int min1, ref int max0, ref int max1, ref int br0, ref int br1)
        {
            min0 = 0;
            min1 = 0;
            max0 = 0;
            max1 = 0;
            br0 = 0;
            br1 = 0;
        }
        static void Main(string[] args)
        {
            string[] niz = Console.ReadLine().Split();
            int n = int.Parse(niz[0]);
            int c = int.Parse(niz[1]);
            int q = int.Parse(niz[2]);
            string s = Console.ReadLine();
            int[] l = new int[q+1], r = new int[q+1];
            int sum = 0, i = 0, min0 = 0, min1 = 0, max0 = 0, max1 = 0, br0 = 0, br1 = 0;
            int[] nule = new int[n], jedinice = new int[n];
            string[] ss=new string[q+1];
            ss[0] = s;
            for (i=0;i<q;i++)
            {
                niz = Console.ReadLine().Split();
                l[i] = int.Parse(niz[0]);
                r[i] = int.Parse(niz[1]);
            }
            string s1 = s.Replace("1", "0");
            for (i = 0; i < q; i++)
            {
                int l1 = l[i]-1;
                int r1 = r[i]-1;
                s = ss[i];
                promenaNiz(ref s, l1, r1);
                ss[i+1] = s;
                while (s != s1)
                {
                    brojke(s, ref min0, ref min1, ref max0, ref max1, ref br0, ref br1, ref nule, ref jedinice);
                    if (br1 > br0)
                    {
                        promenaNiz(ref s, min1, max1);
                        sum += c;
                    }
                    reset(ref min0, ref min1, ref max0, ref max1, ref br0, ref br1);
                    brojke(s, ref min0, ref min1, ref max0, ref max1, ref br0, ref br1, ref nule, ref jedinice);
                    while(br1>0)
                    {
                        if (s.Contains("111"))
                        {
                            promenaNiz(ref s, min1, max1);
                            sum += c;
                        }
                        else
                        {
                            promenaNiz(ref s, min1, min1);
                            sum++;
                        }
                        reset(ref min0, ref min1, ref max0, ref max1, ref br0, ref br1);
                    }
                }
                Console.WriteLine(sum);
                sum = 0;
            }
        }
    }
}