using System;
namespace Niz
{
    class Program
    {
        static void zameni(int n, ref char[] s, int l, int r)
        {
            for (int j = l - 1; j < r; j++)
            {
                if (s[j] == '1') s[j] = '0';
                else  s[j] = '1';
            }
        }
        static void prebroji_nule(int n, char[] s, out int br1, out int br0)
        {
            br1 = 0;
            br0 = 0;
            for (int j = 0; j < n; j++)
            {
                if (s[j] == '1') br1++;
                else br0++;
            }
        }
        static void Main(string[] args)
        {
            string[] red = Console.ReadLine().Split(' ');
            int n = int.Parse(red[0]), c = int.Parse(red[1]), q = int.Parse(red[2]);
            string str = Console.ReadLine();
            char[] s = new char[n];
            char[] dod = new char[n];
            for (int f = 0; f < n; f++)
            {
                s[f] = str[f];
                dod[f] = str[f];
            }

            for (int i = 0; i < q; i++)
            {
                string[] x = Console.ReadLine().Split(' ');
                int cena = 0, l = int.Parse(x[0]), r = int.Parse(x[1]);
                zameni(n, ref s, l, r);
                for (int f = 0; f < n; f++)
                {
                    dod[f] = s[f];
                }
                int br1, br0;
                prebroji_nule(n, dod, out br1, out br0);
                if (br0 > br1)
                {
                    for (int j = 0; j < n; j++)
                    {
                        if (dod[j] == '1')
                        {
                            cena++;
                            dod[j] = '0';
                        }
                    }
                }
                else
                {
                    int flag = 0;
                    for (int j = 0; j < n; j++)
                    {
                        if (dod[j] == '1')
                        {
                            flag = 1;
                            dod[j] = '0';
                        }
                        else if (dod[j] == '0' && flag == 1)
                        {
                            dod[j] = '1';
                        }
                    }
                    cena += c;
                    for (int j = 0; j < n; j++)
                    {
                        if (dod[j] == '1')
                        {
                            cena++;
                            dod[j] = '0';
                        }
                    }
                }
                Console.WriteLine(cena);
            }
        }
    }
}