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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var arr = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int n = arr[0];
            int x = arr[1];
            int y = arr[2];
            string s = Console.ReadLine();

            string cmp = "1";
            for (int i = 0; i < y; i++)
                cmp += '0';

            var a = s.Reverse().ToArray();
            var b = cmp.Reverse().ToArray();

            int cnt = 0, j = 0;
            for (int i = 0; i < y + 1; i++)
            {
                if (a[i] != b[j])
                    ++cnt;

                ++j;
            }

            if (s[y + 2] != '0')
                ++cnt;

            Console.WriteLine(cnt);
        }
    }
}


namespace Problem
{
    using System;
    using System.Collections.Generic;
    using System.Collections;
    using System.Linq;
    class problem
    {
        static void Main()
        {
            var inp = Array.ConvertAll( Console.ReadLine().Split(), Convert.ToInt32 );
            int n = inp[0], x = inp[1], y = inp[2];
            string str = Console.ReadLine().Substring(n-x,x);
            string ss="1";
            for(int i=0;i<y;i++)ss+="0";
            for(int i=1;i<x-y;i++)
                ss="0"+ss;
            int kq = 0;
            for(int i = 0 ; i < ss.Length ; i++)
                if(str[i] != ss[i])
                    kq++;
            Console.WriteLine( kq );
        }
    }

}


using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using SB = System.Text.StringBuilder;
//using System.Threading.Tasks;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
using System.Numerics;
using static System.Math;
using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    readonly Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    readonly int dom = 998244353;
    bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }

    void solve()
    {
        int N = cin.nextint;
        int X = cin.nextint;
        int Y = cin.nextint;
        var S = cin.next.reverse();

        int cnt = 0;
        for (int i = 0; i < X; i++)
        {
            if (i == Y)
            {
                if(S[i] == '0')
                {
                    cnt++;
                }
            }
            else
            {
                if (S[i] == '1')
                {
                    cnt++;
                }
            }
        }
        WriteLine(cnt);
    }

}

static class Ex
{
    public static void join<T>(this IEnumerable<T> values, string sep = " ") => WriteLine(string.Join(sep, values));
    public static string concat<T>(this IEnumerable<T> values) => string.Concat(values);
    public static string reverse(this string s) { var t = s.ToCharArray(); Array.Reverse(t); return t.concat(); }

    public static int lower_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) < 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
    public static int upper_bound<T>(this IList<T> arr, T val) where T : IComparable<T>
    {
        int low = 0, high = arr.Count;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid].CompareTo(val) <= 0) low = mid + 1;
            else high = mid;
        }
        return low;
    }
}

class Pair<T, U> : IComparable<Pair<T, U>> where T : IComparable<T> where U : IComparable<U>
{
    public T f; public U s;
    public Pair(T f, U s) { this.f = f; this.s = s; }
    public int CompareTo(Pair<T, U> a) => f.CompareTo(a.f) != 0 ? f.CompareTo(a.f) : s.CompareTo(a.s);
    public override string ToString() => $"{f} {s}";
}

class Scanner
{
    string[] s; int i;
    readonly char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan => ReadLine().Split();
    public int[] scanint => Array.ConvertAll(scan, int.Parse);
    public long[] scanlong => Array.ConvertAll(scan, long.Parse);
    public double[] scandouble => Array.ConvertAll(scan, double.Parse);
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint => int.Parse(next);
    public long nextlong => long.Parse(next);
    public double nextdouble => double.Parse(next);
}


using System;
using System.Linq;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();

			var n = inputs.ElementAt(0);
			var x = inputs.ElementAt(1);
			var y = inputs.ElementAt(2);

			string number = Console.ReadLine();
			int result = 0;
			int index = n - 1 - y;
			for (int i = n - 1; i > n - x - 1; i--)
			{
				var element = number.ElementAt(i);
				if (i != index && element != '0')
				{
					result++;
				}

				if (i == index && element != '1')
				{
					result++;
				}
			}

			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}


using System;
using System.Linq;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();

			var n = inputs.ElementAt(0);
			var x = inputs.ElementAt(1);
			var y = inputs.ElementAt(2);

			string number = Console.ReadLine();
			int result = 0;
			int index = n - 1 - y;
			for (int i = n - 1; i > n - x - 1; i--)
			{
				if (i != index && number.ElementAt(i) != '0')
				{
					result++;
				}

				if (i == index && number.ElementAt(i) != '1')
				{
					result++;
				}
			}

			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}


using System;
using System.Linq;
using System.Text;

namespace Codeforces
{
	class Program
	{
		static void Main(string[] args)
		{
			string input = Console.ReadLine();
			var inputs = input.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToList();

			var n = inputs.ElementAt(0);
			var x = inputs.ElementAt(1);
			var y = inputs.ElementAt(2);

			string number = Console.ReadLine();
			int result = 0;
			int index = n - 1 - y;
			//for (int i = n - 1; i > n - x - 1; i--)
			//{
			//	var element = number.ElementAt(i);
			//	if (i != index && element != '0')
			//	{
			//		result++;
			//	}

			//	if (i == index && element != '1')
			//	{
			//		result++;
			//	}
			//}

			var before = number.Substring(n - x, x - y - 1);
			var after = number.Substring(n - y);

			if (number.ElementAt(index) != '1')
			{
				result++;
			}

			result += before.Count(e => e != '0');
			result += after.Count(e => e != '0');
			Console.WriteLine(result);
		}

		//private static int Length(short[] a)
		//{
		//	int firstItemIndex = 0;
		//	for (int i = 0; i < a.Length; i++)
		//	{
		//		if (a[i] == 0)
		//		{
		//			continue;
		//		}

		//		firstItemIndex = i;
		//		break;
		//	}

		//	return a.Length - firstItemIndex;
		//}

		//private static short[] Subtract(short[] a, short[] b)
		//{
		//	if (a.Length != b.Length)
		//	{
		//		throw new ArgumentException();
		//	}

		//	short[] result = new short[a.Length];
		//	Array.Copy(a, result, a.Length);
		//	for (int i = result.Length - 1; i >= 0; i--)
		//	{
		//		if (result[i] < b[i])
		//		{
		//			int j = i - 1;
		//			while (result[j] == 0)
		//			{
		//				result[j--] = 9;
		//			}

		//			result[j]--;
		//			result[i] += 10;
		//		}

		//		result[i] -= b[i];
		//	}

		//	return result;
		//}

		//private static short[] Multiply(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	for (int i = a.Length - 1; i > 0; i--)
		//	{
		//		int temp = a[i] * b;
		//		result[i] = (short)(result[i] + temp % 10);
		//		result[i - 1] = (short)(result[i - 1] + temp / 10);
		//	}

		//	return result;
		//}

		//private static int Mod(short[] a, int b)
		//{
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		rest = d % b;
		//		i++;
		//	}

		//	return rest;
		//}

		//private static short[] Divide(short[] a, int b)
		//{
		//	short[] result = new short[a.Length];
		//	int rest = 0, i = 0;
		//	while (i < a.Length)
		//	{
		//		int d = 10 * rest + a[i];
		//		while (d < b && i < a.Length - 1)
		//		{
		//			d = 10 * d + a[++i];
		//		}

		//		result[i] = (short)(d / b);
		//		rest = d % b;
		//		i++;
		//	}

		//	return result;
		//}
	}
}


using System;
using System.Linq;

namespace Contests {
    public class CF560_A {
        public static void Main() {
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var y = input[1];
            var x = input[2];
            var s = new string(Console.ReadLine().Reverse().ToArray());
            var result = 0;
            for (var i = 0; i < x; i++) {
                if (s[i] == '1') result++;
            }

            if (s[x] == '0') result++;
            for (var i = x + 1; i < y; i++) {
                if (s[i] == '1') result++;
            }
            Console.WriteLine(result);
        }
    }
}


#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_labels)]

use std::char::*;
use std::cmp::*;
use std::collections::*;
use std::io::*;
use std::str::FromStr;

macro_rules! debug {($($a:expr),*) => {println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);}}
macro_rules! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
macro_rules! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

use std::f64;

fn min<T: PartialOrd>(a:T, b:T) -> T {
    if a < b { a }
    else { b }
}

fn max<T: PartialOrd>(a:T, b:T) -> T {
    if a < b { b }
    else { a }
}

const MAX:usize = 30;
const INF:i64 = std::i64::MAX;
const MOD:i64 = 1e9 as i64 + 7;

fn main() {
    //let t:usize = read();

    //'outer: for _ in 0..t {
       let n:usize = read();
       let x:usize = read();
       let y:usize = read();
       let mut s:Vec<char> = read::<String>().chars().collect();
       s.reverse();

       let mut cnt = 0;
       for i in 0..x {
           if i == y {
               if s[i] != '1' { cnt += 1; }
           } else {
               if s[i] != '0' { cnt += 1; }
           }
       }
       println!("{}", cnt);
    //}
}

/*

*/


#![allow(unused_imports)]

use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, stdout, BufWriter, Write};

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>,
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn solve() {
    let mut scan = Scanner::default();
    let n: usize = scan.next();
    let x: usize = scan.next();
    let y: usize = scan.next();
    let s: String = scan.next();
    let mut v: Vec<char> = s.chars().collect();
    v.reverse();
    let mut res = 0;
    for c in &v[..y] {
        if c == &'1' {
            res += 1;
        }
    }
    if v[y] == '0' {
        res += 1;
    }
    for c in &v[y+1..x] {
        if c == &'1' {
            res += 1;
        }
    }
    println! ("{}", res);
}

fn main() {
    let mut scan = Scanner::default();
    // let t = scan.next::<u64>();
    let t = 1;
    for _ in 0..t {
        solve();
    }
}


#[allow(unused_imports)]
use std::cmp::{min,max};
use std::io::{BufWriter, stdin, stdout, Write};
const BITS: usize = 19;

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>
}

impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}

fn main() {
    let mut scan = Scanner::default();
    let out = &mut BufWriter::new(stdout());

    let n = scan.next::<usize>();
    let x = scan.next::<usize>();
    let y = scan.next::<usize>();
    let s: String = scan.next();

    println!("{}",solve(n, x, y, s) );

    assert!(solve(11, 5, 2, "11010100101".to_string()) == 1);
    assert!(solve(11, 5, 1, "11010100101".to_string()) == 3);
    assert!(solve(11, 10, 0, "10000000000".to_string()) == 1);
    assert!(solve(11, 10, 0, "10000000001".to_string()) == 0);
    assert!(solve(11, 10, 0, "10000000001".to_string()) == 0);
    assert!(solve(11, 10, 0, "10000000001".to_string()) == 0);
    assert!(solve(2, 1, 0, "11".to_string()) == 0);
    assert!(solve(2, 1, 0, "10".to_string()) == 1);
}

fn solve(n: usize, x: usize, y:usize, s: String) -> u32 {
    let mut c: u32 = 0;
    for (i, d) in s[(n-x)..n].chars().rev().enumerate() {
        if (d == '1' && i != y) || (d == '0' && i == y) {
            c += 1;
        }
    }
    return c;
}


use std::io;

// type Matrix = Vec<Vec<char>>;

fn read_line() -> String {
    let mut input_line = String::new();
    io::stdin().read_line(&mut input_line).unwrap();
    return String::from(input_line.trim());
}

fn read_line_vec() -> Vec<i64> {
    return read_line().split(' ')
        .map(|s| s.parse().unwrap())
        .collect();
}

fn read_line_tuple3() -> (i64, i64, i64) {
    let vec = read_line_vec();
    return (vec[0], vec[1], vec[2]);
}

fn main() {
    let (n, x, y) = read_line_tuple3();
    let line = read_line();

    let mod_x: Vec<char> = line.chars().rev().take(x as usize).collect();
    let mut mod_expected = vec!['0'; x as usize];
    mod_expected[y as usize] = '1';

    let diff = mod_x.iter().zip(mod_expected.iter()).filter(|(a, b)| *a != *b).count();

    let mod_x_str: String = mod_x.iter().collect();
    let mod_expected_str: String = mod_expected.iter().collect();

    // println!("{} vs {} diff {}", mod_x_str, mod_expected_str, diff);
    println!("{}", diff);

}


package main

import "fmt"

func gen10(x, y int) string {
	s := ""
	for i := 0; i <= x; i++ {
		if i == 0 {
			s += "1"
		} else {
			if x-i == y {
				s += "1"
			} else {
				s += "0"
			}
		}
	}
	return s
}

func main() {
	var n, x, y int
	var s string
	fmt.Scanf("%d%d%d\n", &n, &x, &y)
	fmt.Scanf("%s\n", &s)

	ss := s[(n - x - 1):]
	sxy := gen10(x, y)

	sn := len(ss)
	res := 0
	for i := 0; i < sn; i++ {
		if ss[i] != sxy[i] {
			res++
		}
	}
	// fmt.Println(ss, sxy)
	fmt.Println(res)
}

/*
11 5 2
11010100101

11 5 1
11010100101
*/


#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,x,y;
    string s;
    scanf("%d %d %d\n",&n,&x,&y);
    cin>>s;

    int res=0;
    int a = n-x-1;
    int b = n-y-1;
    for(int i=a;i<n;i++){
        if(i==a) continue;
        if(i==b){
            if(s[i]!='1') res++;
            continue;
        }
        if(s[i]!='0') res++;
    }
    printf("%d\n",res);
}


package main

import (
	"fmt"
)

func main() {
	var n, x, y, ans int
	ans = 0;
	var s string
	fmt.Scan(&n, &x, &y, &s)
	for i:=n-1; i>=n-x; i-- {
		if i==n-1-y {
			if s[i]==byte('0'){
				ans++
			} else {}
		} else{
			if s[i]==byte('1'){
				ans++;
			} else {}
		}
	}
	fmt.Println(ans);
}


package main

import "fmt"

func main () {
	var n, x, y, cnt int
	cnt = 0
	var str string
	fmt.Scan(&n, &x, &y, &str)
	for i := n-1; i > n-x-1; i-- {
		if string(str[i]) != "0" && i != n-y-1 {
			cnt++
		} else if string(str[i]) != "1" && i == n-y-1 {
			cnt++
		}
	}
	fmt.Println(cnt)
}


<?php
# 1165A
declare(strict_types=1);

$start = microtime(true);
$stdin = STDIN;
[$n, $x, $y] = fscanf($stdin, '%u %u %u');

$xi = $n - $x - 1;
$yi = $n - $y - 1;

$result = 0;

$digit = trim(fgets($stdin));

for ($i = $n -1; $i > $xi; $i--) {
    if ((($i > $yi) || ($i > $xi && $i < $yi)) && $digit[$i] === '1') {
        $result++;
    } elseif($i === $yi && $digit[$i] === '0') {
        $result++;
    }
}

echo $result;


<?php
# 1157E
declare(strict_types=1);

$start = microtime(true);
$stdin = STDIN;
[$n] = fscanf($stdin, '%u');

$arrA = array_map('intval', explode(' ', fgets($stdin))) + [];
$arrB = array_map('intval', explode(' ', fgets($stdin))) + [];

sort($arrB);

$amountB = array_fill(0, $n, 0);
foreach ($arrB as $itemB) {
    $amountB[$itemB]++;
}
unset($arrB);

$orderList = array_keys($amountB);
unset($orderList[0]);
sort($orderList);
$orderList[] = 0;

$result = '';

foreach ($arrA as $i => $itemA) {
    $currentValue = ($n - $itemA) % $n;
    while ($amountB[$currentValue] === 0) {
        $nextValue = $orderList[$currentValue];
        if ($amountB[$nextValue] === 0) {
            $nextValue = $orderList[$currentValue] = $orderList[$nextValue];
        }
        $currentValue = $nextValue;
    }
    $result .= ($i ? ' ' : '') . (($itemA + $currentValue) % $n);
    $amountB[$currentValue]--;
}
//echo implode(' ', $arrC);
echo PHP_EOL . (microtime(true) - $start) . PHP_EOL;
echo ceil(memory_get_peak_usage() / 1024) . 'KB' . PHP_EOL;
//echo $result;


 <?php
    $s1 = trim(fgets(STDIN));
    $s = trim(fgets(STDIN));

    $a1 = explode(" ", $s1);
    $n = $a1[0];
    $x = $a1[1];
    $y = $a1[2];

    $iteration = 0;
    if ( bcmod ($s,bcpow(10, $x)) == bcpow (10, $y)) {
        echo $iteration;
        exit;
    }

    for ($i=$n-1; $i >= 0; $i--) {
        if($s[$i] == 0) {
            $s[$i] = 1;
        } else {
            $s[$i] = 0;
        }
        $iteration++;
        if ( bcmod ($s,bcpow(10, $x)) == bcpow (10, $y)) {
            echo $iteration;
            exit;
        }
    }

?>


n,x,y=map(int,raw_input().split())
a=raw_input()
a=a[::-1]
#print a
cnt=0
for i in xrange(x):
    if i == y:
        if a[i] == '0':
            cnt += 1
    else:
        if a[i]=='1':
            cnt += 1
    #print i,cnt
print cnt


n,x,y=map(int,raw_input().split())
a=map(int,raw_input().split())
a=a[::-1]
cnt=0
for i in xrange(n+1):
    if a[i]==1:
        cnt += 1
print cnt


n, x, y = map(int, raw_input().split())
s = raw_input()[-x:][::-1]
c = 0
for i in range(len(s)):
    if i == y and s[i] == '0': c += 1
    if i != y and s[i] == '1': c += 1
print c


import sys
rl = lambda: sys.stdin.readline().split()

n, x, y = map(int, rl())
A = raw_input().strip()
r = "0" * (x-y-1) + "1" + "0" * y
cnt = 0
for c1, c2 in zip(r, A[-x:]):
	if c1 != c2:
		cnt += 1
print cnt


from sys import stdin,stdout
I = lambda : map(int,stdin.readline().split())
p = lambda x: stdout.write(str(x)+" ")
pa = lambda list: stdout.write(" ".join(str(x) for x in list))

n,x,y = I()
s = raw_input()
if y<x:
	print s[n-x:n-y-1].count('1') + (s[n-y-1]!='1') + s[n-y:].count("1") + (s[n-x-1]!='1')
else:
	print s[n-x:].count("1") + (s[n-x-1]!='1')


from sys import stdin,stdout
I = lambda : map(int,stdin.readline().split())
p = lambda x: stdout.write(str(x)+" ")
pa = lambda list: stdout.write(" ".join(str(x) for x in list))

n,x,y = I()
s = raw_input()
if y<x:
	print s[n-x:n-y-1].count('1') + (s[:n-x].count('1')<1) + s[n-y:].count("1") + (s[n-y-1]!='1')
else:
	print s[n-x:].count("1") + (s[n-x-1]!='1')


from sys import stdin,stdout
I = lambda : map(int,stdin.readline().split())
p = lambda x: stdout.write(str(x)+" ")
pa = lambda list: stdout.write(" ".join(str(x) for x in list))

n,x,y = I()
s = raw_input()
if y<x:
	print s[n-x:n-y-1].count('1') + (s[:n-x-1].count('1')<1) + s[n-y:].count("1") + (s[n-y-1]!='1')
else:
	print s[n-x:].count("1") + (s[n-x-1]!='1')


n,x,y=map(int,raw_input().split())
k=raw_input()
ct=0
for i in range(n-x,n):
    if i==n-y-1 :
        ct+=k[i]!='1'
    else:
        ct+=k[i]!='0'
print ct


n,x,y=map(int,raw_input().split())
k=raw_input()
ct=0
k=k[n-x:]
for i in range(len(k)):
    if i==y and k[i]=='0':
        ct+=1
    if k[i]=='1' and i!=y:
        ct+=1
print ct


# -*- coding: utf-8 -*-
import sys,fractions
def fi():
    return int(sys.stdin.readline())

def fi2():
    return map(int, sys.stdin.readline().split())

def fi3():
    return sys.stdin.readline()

def fo(*args):
    for s in args:
        sys.stdout.write(str(s)+' ')
    sys.stdout.write('\n')
INF=10**9+7
sys.setrecursionlimit(INF)
#main
n,y,x=fi2()
s=raw_input()
a=0
for i in range(n-1,n-1-y,-1):
    if i==n-x-1:
        if s[i]=="0":
            a+=1
    else:
        if s[i]=="1":
            a+=1
fo(a)


from collections import Counter as D, defaultdict as dd
from bisect import insort as ins, bisect_left as bl, bisect_right as br

from math import log
import sys
raw_input=sys.stdin.readline
f1=lambda : map(int,raw_input().split())
f2=lambda : map(int,list(raw_input()))
f3=lambda : int(raw_input())
f4=lambda : raw_input().rstrip()
f5=lambda : raw_input().split()
f6=lambda : list(raw_input().rstrip())
f7=lambda : map(int, set(raw_input()))
f8=lambda : set(raw_input())

def main():

	n,x,y=f1()
	s=f4()

	ans=0
	for i in xrange(n-1,n-x-1,-1):
		if s[i]=='1':
			ans=ans+1

	if s[n-y-1]=='1':
		ans=ans-1
	else:
		ans=ans+1

	print ans

if __name__ == '__main__':
	main()


#!/usr/bin/env python
"""<https://github.com/cheran-senthil/PyRival>"""
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    _str = str
    str = lambda x=b"": x if type(x) is bytes else _str(x).encode()

def main():
    n, x, y = map(int, input().split())
    d = input()

    _d = d[-x:]
    if _d[-y - 1] == '1':
        print(_d.count('1') - 1)
    else:
        print(_d.count('1') + 1)

# region fastio

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._buffer = BytesIO()
        self._fd = file.fileno()
        self._writable = "x" in file.mode or "r" not in file.mode
        self.write = self._buffer.write if self._writable else None

    def read(self):
        if self._buffer.tell():
            return self._buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()

    def flush(self):
        if self._writable:
            os.write(self._fd, self._buffer.getvalue())
            self._buffer.truncate(0), self._buffer.seek(0)

def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()

sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b"\r\n")

# endregion

if __name__ == "__main__":
    main()


import sys
import math
import bisect
import atexit
import io
import heapq
from collections import defaultdict, Counter
MOD = int(1e9+7)

# n = map(int, raw_input().split())
# input = map(int, raw_input().split())

n,x,y = map(int, raw_input().split())
st = raw_input()
st = st[-x:]
ta = '0'*(x-y-1)+'1'+'0'*y
ans = 0
for i,j in zip(st,ta):
    if i!=j:
        ans+=1
print ans


from __future__ import division, print_function

def main():
    n, x, y = map(int, input().split())
    s = input()
    ans = 0
    for i in range(n - x, n):
        if i == n - y - 1:
            ans += (s[i] != '1')
        else:
            ans += (s[i] != '0')

    print(ans)

# PyPy 2 Fast IO
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Importing Modules
import math
import collections

from collections import Counter
from math import fabs

if __name__ == "__main__":
    main()


from __future__ import division, print_function

def main():
    n, x, y, s = input().split()
    n, x, y, ans = int(n), int(x), int(y), 0
    for i in range(n - x, n):
        if i == n - y - 1:
            ans += (s[i] != '1')
        else:
            ans += (s[i] != '0')

    print(ans)

# PyPy 2 Fast IO
py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Importing Modules
import math
import collections

from collections import Counter
from math import fabs

if __name__ == "__main__":
    main()


import sys,math
from fractions import gcd
from bisect import bisect_left, bisect
from collections import defaultdict
from io import BytesIO
sys.stdin = BytesIO(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')
#n = int(input())

n,l,r = [int(_) for _ in input().split()]

res = [int(_) for _ in list(input())]
x = 0
for i in range(n-l-1,n):
    if i == n-l-1 or i == n-r-1:
        if res[i] == 0:
            x += 1
    else:
        if res[i] == 1:
            x += 1
print(x)


import sys,math
from fractions import gcd
from bisect import bisect_left, bisect
from collections import defaultdict
from io import BytesIO
sys.stdin = BytesIO(sys.stdin.read())
input = lambda: sys.stdin.readline().rstrip('\r\n')
#n = int(input())

n,l,r = [int(_) for _ in input().split()]

res = [int(_) for _ in list(input())]
x = 0
for i in range(n-l,n):
    if i == n-r-1:
        if res[i] == 0:
            x += 1
    else:
        if res[i] == 1:
            x += 1
print(x)


n, x, y = map(int, raw_input().split())
s = raw_input()[::-1]

cnt = 0
for i in range(x):
    want = '0' if i != y else '1'
    if want != s[i]:
        cnt += 1

print cnt


# m = map(int, raw_input().split())
# s = raw_input()
# l = raw_input().split()
a, b, c = map(int, raw_input().split())
n = raw_input()
# print n
n = n[::-1]
ans = 0
for i in xrange(b):
    if i == c:
        if n[i] == '0':
            ans += 1
    else:
        if n[i] == '1':
            ans += 1
print ans


def main():
	n,x,y=map(int,input().split())
	a=input()
	ans=0
	if a[n-y-1]!='1':
		ans+=1
	for i in range(n-x,n):
		if i==n-y-1:
			continue
		if a[i]!='0':
			ans+=1
	cout<<ans

#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
######## Python 2 and 3 footer by pajenegod and c1729

# Note because cf runs old PyPy3 version which doesn't have the sped up
# unicode strings, PyPy3 strings will many times be slower than pypy2.
# There is a way to get around this by using binary strings in PyPy3
# but its syntax is different which makes it kind of a mess to use.

# So on cf, use PyPy2 for best string performance.

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192
class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0,2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO,self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill(); self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)

class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s:self.buffer.write(s.encode('ascii'))
            self.read = lambda:self.buffer.read().decode('ascii')
            self.readline = lambda:self.buffer.readline().decode('ascii')

sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')

# Cout implemented in Python
import sys
class ostream:
    def __lshift__(self,a):
        sys.stdout.write(str(a))
        return self
cout = ostream()
endl = '\n'

# Read all remaining integers in stdin, type is given by optional argument, this is fast
def readnumbers(zero = 0):
    conv = ord if py2 else lambda x:x
    A = []; numb = zero; sign = 1; i = 0; s = sys.stdin.buffer.read()
    try:
        while True:
            if s[i] >= b'0' [0]:
                numb = 10 * numb + conv(s[i]) - 48
            elif s[i] == b'-' [0]: sign = -1
            elif s[i] != b'\r' [0]:
                A.append(sign*numb)
                numb = zero; sign = 1
            i += 1
    except:pass
    if s and s[-1] >= b'0' [0]:
        A.append(sign*numb)
    return A

# My magical way of doing recursion in python. This
# isn't the fastest, but at least it works.
from types import GeneratorType
def bootstrap(func, stack=[]):
    def wrapped_function(*args, **kwargs):
        if stack:
            return func(*args, **kwargs)
        else:
            call = func(*args, **kwargs)
            while True:
                if type(call) is GeneratorType:
                    stack.append(call)
                    call = next(call)
                else:
                    stack.pop()
                    if not stack:
                        break
                    call = stack[-1].send(call)
            return call

    return wrapped_function

if __name__=="__main__":
	main()


n,x,y = raw_input().split()
x = int(x)
y = int(y)
t = str(raw_input())
t = t[-x:]
t = t[::-1]
res = 0
for i in range(x):
    if i == y:
        if t[i] == '1':
            pass
        else:
            res += 1
    else:
        if t[i] == '0':
            pass
        else:
            res += 1
print res


from collections import Counter, defaultdict
from itertools import combinations

n,x,y=map(int,raw_input().split())
arr=raw_input()[-x:]
h='1'+'0'*y
h='0'*(x-len(h))+h
ans=0
for i in range(len(h)):
	ans=ans+int(h[i])^int(arr[i])
print ans


from collections import Counter, defaultdict
from itertools import combinations

# n,x,y=map(int,raw_input().split())
# arr=raw_input()[-x:]
# h='1'+'0'*y
# h='0'*(x-len(h))+h
# ans=0
# for i in range(len(h)):
# 	ans=ans+int(h[i])^int(arr[i])
# print ans
n, x, y = map(int, raw_input().split())
s = raw_input()
s, res = s[::-1], 0
for i in range(x):
    if i == y:
        res += (s[i] == '0')
    else:
        res += (s[i] == '1')
print res


from __future__ import division, print_function

def main():
    n, x, y = input_as_list()
    s = input()
    ans = 0
    for i, c in enumerate(reversed(s)):
        if i == y:
            ans += [1, 0][c=='1']
        else:
            ans += [0, 1][c=='1']
        if i == x-1:
            break
    print(ans)

INF = float('inf')
MOD = 10 ** 9 + 7
__interactive = False

import os, sys
from atexit import register
from io import BytesIO
import itertools
import __pypy__

if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

if "LOCAL_" in os.environ:
    debug_print = print
else:
    if not __interactive:
        sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
        sys.stdout = BytesIO()
        register(lambda: os.write(1, sys.stdout.getvalue()))

        input = lambda: sys.stdin.readline().rstrip('\r\n')
    debug_print = lambda *x, **y: None

flush = sys.stdout.flush

def mulmod(x, y):
    return __pypy__.intop.int_mulmod(x, y, MOD)

def modinv(x):
    return pow(x, MOD-2, MOD)

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def input_as_list():
    return list(map(int, input().split()))

def input_with_offset(o):
    return list(map(lambda x:int(x)+o, input().split()))

def input_as_matrix(n, m):
    return [input_as_list() for _ in range(n)]

def array_of(f, *dim):
    return [array_of(f, *dim[1:]) for _ in range(dim[0])] if dim else f()

def range_with_count(start, step, count):
    return range(start, start + step * count, step)

def indices(l, start=0, end=0):
    return range(start, len(l)+end)

def ceil_power_of_2(n):
    """ [0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, ...] """
    return 2 ** ((n - 1).bit_length())

def ceil_div(x, r):
    """ = ceil(x / r) """
    return (x + r - 1) // r

main()


"""
Author    : raj1307 - Raj Singh
Institute : Jalpaiguri Government Engineering College
Date      : 14.05.19
"""
from __future__ import division, print_function
import itertools,os,sys

from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__
    str = lambda x=b'': x if type(x) is bytes else __str__(x).encode()

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._buffer = BytesIO()
        self._fd = file.fileno()
        self._writable = 'x' in file.mode or 'r' not in file.mode
        self.write = self._buffer.write if self._writable else None

    def read(self):
        return self._buffer.read() if self._buffer.tell() else os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b, ptr = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE)), self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
            self.newlines += b.count(b'\n') + (not b)
        self.newlines -= 1
        return self._buffer.readline()

    def flush(self):
        if self._writable:
            os.write(self._fd, self._buffer.getvalue())
            self._buffer.truncate(0), self._buffer.seek(0)

sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b'\r\n')

def print(*args, **kwargs):
    sep, file = kwargs.pop('sep', b' '), kwargs.pop('file', sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop('end', b'\n'))
    if kwargs.pop('flush', False):
        file.flush()

def ii(): return int(input())
def si(): return str(input())
def mi(): return map(int,input().strip().split(" "))
def li(): return list(mi())

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify, #heappop ,heappush, heapreplace
#from math import ceil,floor,log,sqrt,factorial,pow,pi
#from bisect import bisect_left,bisect_right
#from decimal import *,threading

def dmain():
    sys.setrecursionlimit(100000000)
    threading.stack_size(40960000)
    thread = threading.Thread(target=main)
    thread.start()

abc='abcdefghijklmnopqrstuvwxyz'
abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod=1000000007
dx,dy=[-1,1,0,0],[0,0,1,-1]
def getKey(item): return item[0]
def sort2(l):return sorted(l, key=getKey)
def d2(n,m,num):return [[num for x in range(m)] for y in range(n)]
def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )
def decimalToBinary(n): return bin(n).replace("0b","")
def ntl(n):return [int(i) for i in str(n)]
def powerMod(x,y,p):
    res = 1
    x %= p
    while y > 0:
        if y&1:
            res = (res*x)%p
        y = y>>1
        x = (x*x)%p1
    return res
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

# For getting input from input.txt file
#sys.stdin = open('input.txt', 'r')

# Printing the Output to output.txt file
#sys.stdout = open('output.txt', 'w')

def main():

    n,x,y=mi()
    s=si()
    s=s[::-1]
    op=0
    for i in range(x):
        #print(s[i])
        if i==y:
            if s[i]!='1':
                op+=1
        else:
            if s[i]=='1':
                op+=1

    print(op)

if __name__ == "__main__":
    main()
    #dmain()


l = map(int,raw_input().split())
n = l[0]
x = l[1]
y = l[2]
s = raw_input()
r = 0
for i in range(x):
    if i == y:

        if s[-(i+1)] == '0':
            r+=1

    else:

        if s[-(i+1)] == '1':
            r+=1

print r


from collections import defaultdict as ddic, Counter, deque
from itertools import permutations
rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())
MOD = 10**9 + 7

def solve(N, X, Y, A):
    # Y < X , want 10^y mod 10^x
    A = A[-X:][::-1]
    ans = 0
    for i, x in enumerate(A):
        d = 1 if i == Y else 0
        if x != d:
            ans += 1
    return ans

N, X, Y = rrm()
A = map(int, rr())
print solve(N, X,Y,A)


n, x, y = map(int, raw_input().split())
s = raw_input()

ans = 0
for i in xrange(n - 1, n - 1 - x, -1):
    if i != n - 1 - y:
        if s[i] == '1': ans += 1
    else:
        if s[i] == '0': ans += 1

print ans


from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # n=int(stdin.readline())
    n,x,y=list(map(int,stdin.readline().split()))
    s=input()
    s=s[-x:];ans=0
    for i in range(x-1,-1,-1):
        if i==y:
            if s[i]!='1':ans+=1
        else:ans+=int(s[i]=='1')
    print(ans)


from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # n=int(stdin.readline())
    n,x,y=list(map(int,stdin.readline().split()))
    s=input()
    s=s[-x:];ans=0
    y=x-y-1
    for i in range(x-1,-1,-1):
        if i==y:
            if s[i]!='1':ans+=1
        else:ans+=int(s[i]=='1')
    print(ans)


import math
d,x,y = input().split()
d=int(d)
x=int(x)
y=int(y)
n = input()
n1 = n[-(y+1):]
count = 0
if n1[0] == '0':
    count = count + 1
for i in range(len(n1)-1):
    if n1[i+1] == '1':
        count = count + 1
print(count)


import math
d,x,y = input().split()
d=int(d)
x=int(x)
y=int(y)
n = input()
n1 = n[-(x+1):]
count = 0
for i in range(1,len(n1)-y-1):
    if n1[i] == '1':
        count = count + 1
if n1[len(n1)-y-1] == '0':
    count = count + 1
for i in range(len(n1)-y,len(n1)):
    if n1[i] == '1':
        count = count + 1
print(count)


n, x, y = map(int, input().split())
s = input()
print(s[n - x:n - y - 1].count('1') + s[n - y:].count('1') + (1 if s[n - y - 1] == '0' else 0))


import sys

lines = sys.stdin.readlines()

n, x, y = map(int, lines[0].split())
num = lines[1]
r = 0
for i in range(n-x, n):
    if i == n-(y+1): r += (num[i] != '1')
    else: r += (num[i] == '1')
print(r if r != 0 else -1)


import sys

lines = sys.stdin.readlines()

n, x, y = map(int, lines[0].split())
num = lines[1]
r = 0
for i in range(n-x, n):
    if i == n-(y+1): r += (num[i] != '1')
    else: r += (num[i] == '1')
print(r)


n,x,y=map(int,input().split())
s=input()
te=10**y
t=s[:x+1]
t=t+(n-len(t)-len(str(te)))*'0'+str(te)
#+((n-x-1)-len(str(t)))*'0'
#print(t)
c=0
for i in range(x,n):
    if s[i]!=t[i]:
        c+=1
print(c)


n,x,y=map(int,input().split())
s=input()
c=0
#print(n-x-1,n-1)
for i in range(n-1,n-x-1,-1):
    if i==n-y-1:
        if s[i]!='1':
            c+=1
    else:
        if s[i]!='0':
            c+=1
print(c)


n,x,y = map(int, input().split())
p = int(input()[-x:])
print(str(p^10**y).count('1'))


_,x,y = map(int, input().split())
y = str(10**y).zfill(x)
p = input()[-x:]
print(sum(1 for p1,p2 in zip(y,p) if p1 != p2))


import sys

moves = 0

input = sys.stdin.readlines() # ["11 5 2", "11010100101"]

# print(input)

n, x, y = map(int, input[0].split(" "))

# print([n, x, y])

num = input[1].strip()
# print(num)

if y == 0:
    if num[len(num)] == "1":
        moves += 0
    else:
        moves += 1
else:
    ystr = num[-y:len(num)]
    moves += ystr.count("1")

# print(ystr)
# print(moves)
# xstr = num[-x:len(num)]
# xstr

xydelta = num[-x:-y-1]
# print(xydelta)

moves += xydelta.count("1")
# print(moves)
modchar = num[-y-1]
# modchar

moves += 0 if modchar == "1" else 1
# moves
print(moves)
# input[1] == "11010100101"
# input[0] == "11 5 2"


import sys

moves = 0

input = sys.stdin.readlines() # ["11 5 2", "11010100101"]

# print(input)

n, x, y = map(int, input[0].split(" "))

# print([n, x, y])

num = input[1].strip()
# print(num)

if y == 0
    moves += 0 if num[len(num)] == "1" else 1
else:
    ystr = num[-y:len(num)]
    moves += ystr.count("1")

# print(ystr)
# print(moves)
# xstr = num[-x:len(num)]
# xstr

xydelta = num[-x:-y-1]
# print(xydelta)

moves += xydelta.count("1")
# print(moves)
modchar = num[-y-1]
# modchar

moves += 0 if modchar == "1" else 1
# moves
print(moves)
# input[1] == "11010100101"
# input[0] == "11 5 2"


import sys

moves = 0

input = sys.stdin.readlines() # ["11 5 2", "11010100101"]

# print(input)

n, x, y = map(int, input[0].split(" "))

# print([n, x, y])

num = input[1].strip()
# print(num)

ystr = num[-y:len(num)]
# print(ystr)
moves += ystr.count("1")
# print(moves)
# xstr = num[-x:len(num)]
# xstr

xydelta = num[-x:-y-1]
# print(xydelta)

moves += xydelta.count("1")
# print(moves)
modchar = num[-y-1]
# modchar

moves += 0 if modchar == "1" else 1
# moves
print(moves)
# input[1] == "11010100101"
# input[0] == "11 5 2"


import java.io.*;
import java.util.*;

public class Main implements Runnable {

	public void _main() throws IOException {
		int n = 332;
		int[] x = new int[n];
		int[] p = new int[n];
		x[0] = 1;
		p[0] = 100000;
		int lastX = 10000;
		for (int i = 1; i <= n - 2; i++) {
			x[i] = lastX + 1;
			p[i] = 350 - i + 1;
			lastX = x[i] + 2 * p[i] + 1;
		}
		x[n - 1] = x[0] + 2 * p[0];
		p[n - 1] = 200000;
		out.println(n);
		for (int i = 0; i < n; i++) {
			out.println(x[i] + " " + p[i]);
		}
	}

	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String rl = in.readLine();
			if (rl == null)
				return null;
			st = new StringTokenizer(rl);
		}
		return st.nextToken();
	}

	private int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	private double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		Locale.setDefault(Locale.UK);
		new Thread(new Main()).start();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);

			_main();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(202);
		}
	}

}


//package bayan2012;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;

public class G2 {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = 500;
		long h = 1000000;
		int z = (int)Math.ceil(Math.sqrt((h+498)*(h+498)-(h-498)*(h-498)));
		int xx = z-2*498;

		int[] x = new int[n];
		x[0] = 0;
		// r 498
		for(int i = 1;i < n-1;i++){
			xx += 2*(n-i-1);
			x[i] = xx;
		}
//		tr(x);
		int oo = 374326;
		x[n-1] = oo;

		// (x+y)^2-(x-y)^2=√4xy=u(1/f-1/(f+1))
		int[] p = new int[n];
		p[0] = 1000000;
		p[n-1] = 1000000;
		for(int i = 1;i < n-1;i++){
			p[i] = n-1-i;
		}

		out.println(n);
		for(int i = 0;i < n;i++){
			out.println(x[i] + " " + p[i]);
		}
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception
	{
		new G2().run();
	}

	public int ni()
	{
		try {
			int num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public long nl()
	{
		try {
			long num = 0;
			boolean minus = false;
			while((num = is.read()) != -1 && !((num >= '0' && num <= '9') || num == '-'));
			if(num == '-'){
				num = 0;
				minus = true;
			}else{
				num -= '0';
			}

			while(true){
				int b = is.read();
				if(b >= '0' && b <= '9'){
					num = num * 10 + (b - '0');
				}else{
					return minus ? -num : num;
				}
			}
		} catch (IOException e) {
		}
		return -1;
	}

	public String ns()
	{
		try{
			int b = 0;
			StringBuilder sb = new StringBuilder();
			while((b = is.read()) != -1 && (b == '\r' || b == '\n' || b == ' '));
			if(b == -1)return "";
			sb.append((char)b);
			while(true){
				b = is.read();
				if(b == -1)return sb.toString();
				if(b == '\r' || b == '\n' || b == ' ')return sb.toString();
				sb.append((char)b);
			}
		} catch (IOException e) {
		}
		return "";
	}

	public char[] ns(int n)
	{
		char[] buf = new char[n];
		try{
			int b = 0, p = 0;
			while((b = is.read()) != -1 && (b == ' ' || b == '\r' || b == '\n'));
			if(b == -1)return null;
			buf[p++] = (char)b;
			while(p < n){
				b = is.read();
				if(b == -1 || b == ' ' || b == '\r' || b == '\n')break;
				buf[p++] = (char)b;
			}
			return Arrays.copyOf(buf, p);
		} catch (IOException e) {
		}
		return null;
	}

	double nd() { return Double.parseDouble(ns()); }
	boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 500;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		for(int i = 1; i < n-1; i++){
			writer.println(i + " " + 1);
		}
		writer.println(100000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 400;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 40000;
		for(int i = 1; i < n-1; i++){
			writer.println((pre) + " " + (n-i));
			pre = pre+2*(n-i)-1;
		}
		writer.println(300000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 500;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 1;
		for(int i = 1; i < n-1; i++){
			writer.println((pre+i) + " " + (i+1));
			pre = pre+i+1;
		}
		writer.println(1000000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 400;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 1;
		for(int i = 1; i < n-1; i++){
			writer.println((pre+i) + " " + (i+1));
			pre = pre+2*i+2;
		}
		writer.println(1000000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 301;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 1;
		for(int i = 1; i < n-1; i++){
			writer.println((pre+i) + " " + (i+1));
			pre = pre+2*i+2;
		}
		writer.println(1000000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 400;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 1;
		for(int i = 1; i < n-1; i++){
			writer.println((pre+i) + " " + (i+1));
			pre = pre+2*i+1;
		}
		writer.println(1000000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 301;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 10000;
		for(int i = 1; i < n-1; i++){
			writer.println((pre) + " " + (n-i));
			pre = pre+2*(n-i)-1;
		}
		writer.println(500000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.util.*;
import java.io.*;
public class G {
	public void solve() throws IOException {
		int n = 301;
		writer.println(n);
		writer.println(0 + " " + 1000000);
		int pre = 1;
		for(int i = 1; i < n-1; i++){
			writer.println((pre+i) + " " + (i+1));
			pre = pre+2*i+2;
		}
		writer.println(400000 + " " + 1000000);
	}

	public static void main(String[] args) throws IOException {
		new G().run();
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	public void run() throws IOException {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Stack;
import java.util.StringTokenizer;

public class Main {

	private void solve() throws IOException {
//		println("500");
//		for (int i = 0; i < 500; i++) {
//			println((i * 2) + " " + 1000000);
//		}

		int n = 302;
		int[] x = new int[n];
		int[] p = new int[n];
		x[0] = 0;
		p[0] = 1000000;
		for (int i = 0; i < 300; i++) {
			x[i + 1] = 40000 + i * 600;
			p[i + 1] = 300 - i;
		}
		x[301] = 1000000;
		p[301] = 1000000;

		println(n);
		for (int i = 0; i < n; i++) {
			println(x[i] + " " + p[i]);
		}
//		solve(n, x, p);
	}

	private void update(int i, int j, ArrayList<Double> r, ArrayList<Integer> s, int[] x) {
		int t = s.get(j);
		r.set(i, Math.min(r.get(i), (x[i] - x[t]) * 1.0 * (x[i] - x[t]) / 4 / r.get(t)));
	}

	private void solve(int n, int[] x, int[] p) {
		ArrayList<Double> r = new ArrayList<Double>();
		ArrayList<Integer> s = new ArrayList<Integer>();

		double sum = 0;
		for (int i = 0; i < n; i++) {
			r.add(p[i] * 1.0);
			for (int j = 0; j < Math.min(300, s.size()); j++) {
				update(i, s.size() - j - 1, r, s, x);
			}

			while (!s.isEmpty() && r.get(s.get(s.size() - 1)) <= r.get(i)) {
				s.remove(s.size() - 1);
			}

			s.add(i);
			println(r.get(i));
//			println(s + " " + r.get(i));
			sum += r.get(i);
		}

		println(sum);
	}

	private String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	private double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private void print(Object o) {
		writer.print(o);
	}

	private void println(Object o) {
		writer.println(o);
	}

	private void printf(String format, Object... o) {
		writer.printf(format, o);
	}

	public static void main(String[] args) {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		new Main().run();
		System.err.printf("%.3f\n", 1e-3 * (System.currentTimeMillis() - time));
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	private void run() {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(13);
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.StringTokenizer;

public class Main {

	private void solve() throws IOException {
		println("500");
		for (int i = 0; i < 500; i++) {
			println((i * 2) + " " + 1000000);
		}
	}

	private String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	private double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private void print(Object o) {
		writer.print(o);
	}

	private void println(Object o) {
		writer.println(o);
	}

	private void printf(String format, Object... o) {
		writer.printf(format, o);
	}

	public static void main(String[] args) {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		new Main().run();
		System.err.printf("%.3f\n", 1e-3 * (System.currentTimeMillis() - time));
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	private void run() {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			writer = new PrintWriter(System.out);
			solve();
			reader.close();
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(13);
		}
	}
}


import java.io.*;
import java.util.*;

public class ProblemG {
    InputReader in; PrintWriter out;
    void solve() {
        out.println(301);
        out.println("0 1000");
        List<Double> pos = new ArrayList<Double>();
        List<Double> rad = new ArrayList<Double>();
        pos.add(0.0);
        rad.add(1000.0);
        Double prev = 0.0;
        for (int i = 1; i <= 300; i++) {
            double inc = Math.sqrt(4 * rad.get(i - 1) * (rad.get(i - 1) - 3.0));
            double cur = prev + inc;
            if (i == 300)
                cur += inc;
            pos.add(cur);
            double cr = 1000000;
            for (int j = 0; j < i; j++)
                if (cr > (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j)))
                    cr = (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j));
            prev = cur;
            if (i == 300)
                cr *= 2;
            out.println((int)cur + " " + (int)cr);
            rad.add(cr);
        }
    }

    ProblemG(){
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        try {
            if (oj) {
//              in = new InputReader(System.in);
                out = new PrintWriter(System.out);
            }
            else {
                Writer w = new FileWriter("output.txt");
//              in = new InputReader(new FileReader("input.txt"));
                out = new PrintWriter(w);
            }
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
        solve();
        out.close();
    }
    public static void main(String[] args){
        new ProblemG();
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public InputReader(FileReader fr) {
        reader = new BufferedReader(fr);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


import java.io.*;
import java.util.*;

public class ProblemG {
    InputReader in; PrintWriter out;
    void solve() {
        final int MAX = 310;
        out.println(MAX + 1);
        out.println("0 1000000");
        List<Double> pos = new ArrayList<Double>();
        List<Double> rad = new ArrayList<Double>();
        pos.add(0.0);
        rad.add(1000000.0);
        Double prev = 0.0;

        for (int i = 1; i <= MAX; i++) {
            double inc = Math.sqrt(4 * rad.get(i - 1) * (rad.get(i - 1) - 3.0));
            if (i == 1)
                inc = Math.sqrt(4 * rad.get(i - 1) * 950.0);
            double cur = prev + inc;
            if (i == MAX)
                cur = 1000000;
            pos.add(cur);
            double cr = 1000000;
            for (int j = 0; j < i; j++)
                if (cr > (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j)))
                    cr = (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j));
            prev = cur;
            if (i == MAX) {
                cr = 1000000;
            }
            out.println((int)cur + " " + (int)cr);
            rad.add(cr);
        }
    }

    ProblemG(){
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        try {
            if (oj) {
//              in = new InputReader(System.in);
                out = new PrintWriter(System.out);
            }
            else {
                Writer w = new FileWriter("output.txt");
//              in = new InputReader(new FileReader("input.txt"));
                out = new PrintWriter(w);
            }
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
        solve();
        out.close();
    }
    public static void main(String[] args){
        new ProblemG();
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public InputReader(FileReader fr) {
        reader = new BufferedReader(fr);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


import java.io.*;
import java.util.*;

public class ProblemG {
    InputReader in; PrintWriter out;
    void solve() {
        out.println(301);
        out.println("0 1000");
        List<Double> pos = new ArrayList<Double>();
        List<Double> rad = new ArrayList<Double>();
        pos.add(0.0);
        rad.add(1000.0);
        Double prev = 0.0;
        for (int i = 1; i <= 300; i++) {
            double inc = Math.sqrt(4 * rad.get(i - 1) * (rad.get(i - 1) - 3.0));
            double cur = prev + inc;
            if (i == 300)
                cur += inc;
            pos.add(cur);
            double cr = 1000000;
            for (int j = 0; j < i; j++)
                if (cr > (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j)))
                    cr = (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j));
            prev = cur;

            out.println((int)cur + " " + (int)cr);
            rad.add(cr);
        }
    }

    ProblemG(){
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        try {
            if (oj) {
//              in = new InputReader(System.in);
                out = new PrintWriter(System.out);
            }
            else {
                Writer w = new FileWriter("output.txt");
//              in = new InputReader(new FileReader("input.txt"));
                out = new PrintWriter(w);
            }
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
        solve();
        out.close();
    }
    public static void main(String[] args){
        new ProblemG();
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public InputReader(FileReader fr) {
        reader = new BufferedReader(fr);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


import java.io.*;
import java.util.*;

public class ProblemG {
    InputReader in; PrintWriter out;
    void solve() {
        out.println(301);
        out.println("0 1000000");
        List<Double> pos = new ArrayList<Double>();
        List<Double> rad = new ArrayList<Double>();
        pos.add(0.0);
        rad.add(1000000.0);
        Double prev = 0.0;
        for (int i = 1; i <= 300; i++) {
            double inc = Math.sqrt(4 * rad.get(i - 1) * (rad.get(i - 1) - 3.0));
            if (i == 1)
                inc = Math.sqrt(4 * rad.get(i - 1) * 950.0);
            double cur = prev + inc;
            if (i == 300)
                cur = 1000000;
            pos.add(cur);
            double cr = 1000000;
            for (int j = 0; j < i; j++)
                if (cr > (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j)))
                    cr = (pos.get(i) - pos.get(j)) * (pos.get(i) - pos.get(j)) / (4.0 * rad.get(j));
            prev = cur;
            if (i == 300) {
                cr = 1000000;
            }
            out.println((int)cur + " " + (int)cr);
            rad.add(cr);
        }
    }

    ProblemG(){
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        try {
            if (oj) {
//              in = new InputReader(System.in);
                out = new PrintWriter(System.out);
            }
            else {
                Writer w = new FileWriter("output.txt");
//              in = new InputReader(new FileReader("input.txt"));
                out = new PrintWriter(w);
            }
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
        solve();
        out.close();
    }
    public static void main(String[] args){
        new ProblemG();
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public InputReader(FileReader fr) {
        reader = new BufferedReader(fr);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);
    static int N;
    static ArrayList<Integer> s = new ArrayList<Integer>();
    static ArrayList<Double> r = new ArrayList<Double>();
    static ArrayList<Integer> x = new ArrayList<Integer>();
    static ArrayList<Integer> p = new ArrayList<Integer>();

    static double sq(double v) {
        return v * v;
    }

    static void relax(int i, int j) {
        r.set(i, Math.min(r.get(i), sq(x.get(i) - x.get(j)) / 4 / r.get(s.get(j))));
    }

    static double solve(int n) {
        s.clear();
        r.clear();
        double ans = 0;
        for (int i = 0; i < x.size(); ++i) {
            r.add(1.0 * p.get(i));
            for (int j = 0; j < Math.min(s.size(), n); ++j) {
                relax(i, s.size() - 1 - j);
            }
            while (!s.isEmpty() && r.get(s.get(s.size() - 1)) <= r.get(i)) {
                s.remove(s.size() - 1);
            }
            s.add(i);
            ans += r.get(i);
        }
        return ans;
    }

    public static void main(String[] args) {
        x.add(0);
        p.add(1000000);
        for (int i = 1; i < 499; ++i) {
            double nx = 0;
            int np = 500 - i;
            p.add(np);
            for (int j = 0; j < i; ++j) {
                nx = Math.max(nx, x.get(j) + 2 * Math.sqrt(p.get(i) * np));
            }
            x.add((int) Math.ceil(nx));
        }
        p.add(1000000);
        double nx = 0;
        for (int i = 1; i < x.size(); ++i) {
            nx = Math.max(nx, x.get(i) + 2 * Math.sqrt(p.get(i) * 1000000));
        }
        x.add((int) Math.ceil(nx));

        System.out.println(x.size());
        for (int i = 0; i < x.size(); ++i) {
            System.out.println(x.get(i) + " " + p.get(i));
        }

//      System.out.println(solve(500));
//      System.out.println(solve(300));
    }

}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<math.h>
#include<string>
#include<map>
#include<set>
#include<iostream>
using namespace std;
typedef long long ll;

int main() {
	printf("302\n");
	printf("0 200000\n");
	int s=400000;
	for(int i=0;i<300;i++){
		printf("%d %d\n",s,300-i);
		s+=2*(300-i);
	}
	printf("1000000 1000000\n");
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<math.h>
#include<string>
#include<map>
#include<set>
#include<iostream>
using namespace std;
typedef long long ll;

int main() {
	printf("4\n");
	printf("0 9\n");
	printf("6 3\n");
	printf("12 7\n");
	printf("17 1\n");
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<math.h>
#include<string>
#include<map>
#include<set>
#include<iostream>
using namespace std;
typedef long long ll;

int main() {
	printf("302\n");
	printf("0 200000\n");
	int s=400000;
	for(int i=0;i<300;i++){
		printf("%d %d\n",s,300-i);
		s+=2*(300-i);
	}
	printf("700000 1000000\n");
}


#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<math.h>
#include<string>
#include<map>
#include<set>
#include<iostream>
using namespace std;
typedef long long ll;

int main() {
	printf("401\n");
	for(int i=0;i<400;i++){
		printf("%d 9\n",i*18);
	}
	printf("7183 100\n");
}


#include <iostream>
#define ULL unsigned long long
using namespace std;

int main(void) {
  cout << 500 << endl;
  for (ULL i=0; i<500; i++) {
    cout << i*2000 << " " << 1000 << endl;
  }
  return 0;
}


#include <iostream>
#include <cmath>
#define ULL unsigned long long
using namespace std;

ULL countd (ULL r1, ULL r2) {
  return ((ULL) (sqrt(4*r1*r2)))+1;
}

int main(void) {
  cout << 302 << endl;
  cout << 0 << " " << 1000000 << endl;
  ULL p = countd (1000000, 300);
  for (ULL i=0; i<300; i++) {
    cout << p << " " << 300-i << endl;
    p += countd(300-i, 300-i-1);
  }
  cout << p+countd(1, 1000000) << " " << 1000000 << endl;
  return 0;
}


#include <iostream>
#define ULL unsigned long long
using namespace std;

int main(void) {
  cout << 500 << endl;
  for (ULL i=0; i<498; i++) {
    cout << i << " " << 1 << endl;
  }
  cout << 498 << " " << 10000 << endl;
  cout << 499 << " " << 1000 << endl;
  return 0;
}


#include <iostream>
#define ULL unsigned long long
using namespace std;

int main(void) {
  cout << 500 << endl;
  for (ULL i=0; i<500; i++) {
    cout << i*2000 << " " << 1000*i << endl;
  }
  return 0;
}


#include <stdio.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <iostream>
using namespace std;

#define PI 3.141592653589793
#define INF 2123456789
#define NUL 0.0000001

#define SZ size()
#define CS c_str()
#define PB push_back
#define INS insert
#define EMP empty()
#define CLR clear()
#define LEN length()
#define ull unsigned long long

const int MaxN = 505;
const int MaxR = 1000000;

int x[MaxN], p[MaxN];

void swap(int &a, int &b){
    int c = a; a = b; b = c;
}

int random(){
    int x = rand(), y = rand();
    return (x * 15000 + y) % MaxR;
}

int main(){
    srand(55);
    int n = 500;

    x[1] = 0; p[1] = random() + 1;
    for (int i = 2; i < n; i++){
        x[i] = random();
        p[i] = random() + 1;
    }

    x[n] = 1000000; p[n] = random() + 1;

    for (int i = 1; i <= n; i++)
        for (int j = i + 1; j <= n; j++)
            if (x[i] > x[j]){
                swap(x[i], x[j]);
                swap(p[i], p[j]);
            }

    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d %d\n", x[i], p[i]);
    return 0;
}


#include <stdio.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <iostream>
using namespace std;

#define PI 3.141592653589793
#define INF 2123456789
#define NUL 0.0000001

#define SZ size()
#define CS c_str()
#define PB push_back
#define INS insert
#define EMP empty()
#define CLR clear()
#define LEN length()
#define ull unsigned long long

const int MaxN = 505;

int x[MaxN], p[MaxN];

int main(){
    int n = 500;

    x[1] = 0; p[1] = 1000000;
    for (int i = 2; i < n; i++){
        x[i] = i;
        p[i] = 1;
    }

    x[n] = n + 2000; p[n] = 1000000;

    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d %d\n", x[i], p[i]);
    return 0;
}


#include <stdio.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <iostream>
using namespace std;

#define PI 3.141592653589793
#define INF 2123456789
#define NUL 0.0000001

#define SZ size()
#define CS c_str()
#define PB push_back
#define INS insert
#define EMP empty()
#define CLR clear()
#define LEN length()
#define ull unsigned long long

const int MaxN = 505;

int x[MaxN], p[MaxN];

int main(){
    int n = 500;

    x[1] = 0; p[1] = 1000000;
    for (int i = 2; i < n; i++){
        x[i] = 50000 + n * i;
        p[i] = n - i;
    }

    x[n] = 50000 + n * n + 2000; p[n] = 1000000;

    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d %d\n", x[i], p[i]);
    return 0;
}


#include <stdio.h>
#include <string>
#include <cstring>
#include <algorithm>
#include <memory.h>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <iostream>
using namespace std;

#define PI 3.141592653589793
#define INF 2123456789
#define NUL 0.0000001

#define SZ size()
#define CS c_str()
#define PB push_back
#define INS insert
#define EMP empty()
#define CLR clear()
#define LEN length()
#define ull unsigned long long

const int MaxN = 505;

int x[MaxN], p[MaxN];

int main(){
    int n = 500;

    x[1] = 0; p[1] = 1000000;
    for (int i = 2; i < n; i++){
        x[i] = i;
        p[i] = n - i;
    }

    x[n] = n + 2000; p[n] = 1000000;

    printf("%d\n", n);
    for (int i = 1; i <= n; i++) printf("%d %d\n", x[i], p[i]);
    return 0;
}


#include <iostream>
#include <cstring>
#include <cstdlib>
#include <ctime>

using namespace std;

#define LL long long

int ok(LL x1, LL r1, LL x2, LL r2)
{
	if ((x1-x2)*(x1-x2) >= 4LL*r1*r2) return 1;
	return 0;
}

int main()
{
	int n = 402;
	int x[505], p[505];
	x[1] = 0;
	p[1] = 1000000;
	p[2] = 400;
	for (int i = 2; i <= 401; ++i)
	{
		p[i] = 400 - i + 2;
		int st = x[i-1]+1, dr = x[i-1]+p[i-1]+p[i-1];
		while (st < dr)
		{
			int mij = (st + dr)/2;
			if (ok(x[i-1],p[i-1],mij,p[i])) dr = mij;
			else st = mij + 1;
		}
		x[i] = st;
	}
	p[n] = 1000000;
	int st = x[n-1]+1, dr = x[n-1]+p[n-1]+p[n-1];
	while (st < dr)
	{
		int mij = (st + dr)/2;
		if (ok(x[n-1],p[n-1],mij,p[n])) dr = mij;
		else st = mij + 1;
	}
	x[n] = st;

	//cout << ok(x[1],p[1],x[n],p[n]) << endl;

	cout << n << endl;
	for (int i = 1; i <= n; ++i) cout << x[i] << " " << p[i] << endl;
}


#include <iostream>
#include <cstring>
#include <cstdlib>
#include <ctime>

using namespace std;

#define LL long long

int ok(LL x1, LL r1, LL x2, LL r2)
{
	if ((x1-x2)*(x1-x2) >= 4LL*r1*r2) return 1;
	return 0;
}

int main()
{
	int n = 402;
	int x[505], p[505];
	x[1] = 0;
	p[1] = 1000000;
	p[2] = 400;
	for (int i = 2; i <= 401; ++i)
	{
		p[i] = 400 - i + 2;
		int st = x[i-1]+1, dr = x[i-1]+p[i-1]+p[i-1];
		while (st < dr)
		{
			int mij = (st + dr)/2;
			if (ok(x[i-1],p[i-1],mij,p[i])) dr = mij;
			else st = mij + 1;
		}
		x[i] = st;
	}
	p[n] = 1000000;
	int st = x[n-1]+1, dr = x[n-1]+p[n-1]+p[n-1];
	while (st < dr)
	{
		int mij = (st + dr)/2;
		if (ok(x[n-1],p[n-1],mij,p[n])) dr = mij;
		else st = mij + 1;
	}
	x[n] = 1000000;

	//cout << ok(x[1],p[1],x[n],p[n]) << endl;

	cout << n << endl;
	for (int i = 1; i <= n; ++i) cout << x[i] << " " << p[i] << endl;
}


#include <iostream>
#include <cstring>
#include <cstdlib>
#include <ctime>

using namespace std;

#define LL long long

int ok(LL x1, LL r1, LL x2, LL r2)
{
	if ((x1-x2)*(x1-x2) >= 4LL*r1*r2) return 1;
	return 0;
}

int main()
{
	int n = 302;
	int x[505], p[505];
	x[1] = 0;
	p[1] = 1000000;
	p[2] = 300;
	for (int i = 2; i <= 301; ++i)
	{
		p[i] = 300 - i + 2;
		int st = x[i-1]+1, dr = x[i-1]+p[i-1]+p[i-1];
		while (st < dr)
		{
			int mij = (st + dr)/2;
			if (ok(x[i-1],p[i-1],mij,p[i])) dr = mij;
			else st = mij + 1;
		}
		x[i] = st;
	}
	p[n] = 1000000;
	int st = x[n-1]+1, dr = x[n-1]+p[n-1]+p[n-1];
	while (st < dr)
	{
		int mij = (st + dr)/2;
		if (ok(x[n-1],p[n-1],mij,p[n])) dr = mij;
		else st = mij + 1;
	}
	x[n] = st;

	//cout << ok(x[1],p[1],x[n],p[n]) << endl;

	cout << n << endl;
	for (int i = 1; i <= n; ++i) cout << x[i] << " " << p[i] << endl;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	int n=310, acc=500000;

	printf("%d\n0 1000000\n",n);
	for (int i=1;i<n;i++) {
		acc+=2*(n-i)+2;
		printf("%d %d\n",acc,n-i);
	}
	printf("1000000 1000000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	int n=310, acc=1000;

	printf("%d\n0 1000000\n",n);
	for (int i=1;i<n;i++) {
		acc+=3*(n-i);
		printf("%d %d\n",acc,n-i);
	}
	printf("1000000 1000000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	printf("2\n0 1\n1000000 1000000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	int n=310, acc=500000;

	printf("%d\n0 1000000\n",n);
	for (int i=1;i<n-1;i++) {
		acc+=2*(n-i+100)+2;
		printf("%d %d\n",acc,n-i+100);
	}
	printf("1000000 1000000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	printf("2\n0 5\n100 100\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	printf("2\n0 5\n100 10000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	int n=301, acc=1000;

	printf("%d\n0 1000000\n",n);
	for (int i=1;i<n;i++) {
		acc+=2*(n-i);
		printf("%d %d\n",acc,n-i);
	}
	printf("1000000 1000000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	int n=310, acc=1000;

	printf("%d\n0 1000000\n",n);
	for (int i=1;i<n;i++) {
		acc+=2*(n-i);
		printf("%d %d\n",acc,n-i);
	}
	printf("1000000 1000000\n");
	return 0;
}


#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define INF 0x3f3f3f3f
#define REP(i,n) for(int i=0; i<(n); i++)
typedef long long int64;

int main() {
	int n=310, acc=500000;

	printf("%d\n0 1000000\n",n);
	for (int i=1;i<n;i++) {
		acc+=2*(n-i+100)+2;
		printf("%d %d\n",acc,n-i+100);
	}
	printf("1000000 1000000\n");
	return 0;
}


#include <cstdio>
int main()
{
    printf("%d\n",302);
    printf("%d %d\n",0,100000);
    for (int i=301;i;i--)
        printf("%d %d\n",50000+i,i);
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1005;
char s[maxn][maxn];
int a[maxn];//玩家的速度
int ans[10];
int step[maxn][maxn];
int H[maxn][maxn];//回合
int dir[4][2]={0,1,0,-1,-1,0,1,0};
int n,m,p;
struct node{
	int x,y;
	int id;//第几个玩家
	int step;
	int h;//回合
	node(int u,int v,int w,int c,int f):x(u),y(v),id(w),step(c),h(f){}
	friend bool operator <(node a,node b){
		return a.h==b.h?a.id>b.id:a.h<b.h;
	}
};
priority_queue<node>q;
void BFS(){
	while(!q.empty()){
		node tmp = q.top();q.pop();
		for(int i=0;i<4;i++){
			int tx = tmp.x+dir[i][0];
			int ty = tmp.y+dir[i][1];
			if(tx<0||tx>=n||ty<0||ty>=m)continue;
			if(s[tx][ty]!='.')continue;
			int ck = (tmp.step+a[tmp.id]-1)/a[tmp.id];
			if(step[tx][ty]==-1||(ck<H[tx][ty])){
				step[tx][ty]=tmp.id;
				H[tx][ty]=ck;
				q.push(node(tx,ty,tmp.id,tmp.step+1,ck));
			}
		}
	}
}
int main(){
	cin>>n>>m>>p;
	for(int i=1;i<=p;i++)scanf("%d",&a[i]);
	for(int i=0;i<n;i++){
		scanf("%s",s[i]);
	}
	memset(step,-1,sizeof(step));//id
	memset(H,-1,sizeof(H));
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				if(s[i][j]!='.'&&s[i][j]!='#'){
					int k=s[i][j]-'0';
					q.push(node(i,j,k,0,0));//step和回合
					step[i][j]=k;
				}
			}
		}
		BFS();
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if(step[i][j]!=-1)ans[step[i][j]]++;
		}
	}
	for(int i=1;i<=p;i++){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn = 1005;
char s[maxn][maxn];
int a[maxn];//玩家的速度
int ans[10];
int step[maxn][maxn];
int H[maxn][maxn];//回合
int dir[4][2]={0,1,0,-1,-1,0,1,0};
int n,m,p;
struct node{
	int x,y;
	int id;//第几个玩家
	int step;
	int h;//回合
	node(int u,int v,int w,int c,int f):x(u),y(v),id(w),step(c),h(f){}
	friend bool operator <(node a,node b){
		return a.h==b.h?a.id>b.id:a.h>b.h;
	}
};
priority_queue<node>q;
void BFS(){
	while(!q.empty()){
		node tmp = q.top();q.pop();
		for(int i=0;i<4;i++){
			int tx = tmp.x+dir[i][0];
			int ty = tmp.y+dir[i][1];
			if(tx<0||tx>=n||ty<0||ty>=m)continue;
			if(s[tx][ty]!='.')continue;
			int ck = (tmp.step+a[tmp.id]-1)/a[tmp.id];
			if(step[tx][ty]==-1||(ck<H[tx][ty])){
				step[tx][ty]=tmp.id;
				H[tx][ty]=ck;
				q.push(node(tx,ty,tmp.id,tmp.step+1,ck));
			}
		}
	}
}
int main(){
	cin>>n>>m>>p;
	for(int i=1;i<=p;i++)scanf("%d",&a[i]);
	for(int i=0;i<n;i++){
		scanf("%s",s[i]);
	}
	memset(step,-1,sizeof(step));//id
	memset(H,-1,sizeof(H));
		for(int i=0;i<n;i++){
			for(int j=0;j<m;j++){
				if(s[i][j]!='.'&&s[i][j]!='#'){
					int k=s[i][j]-'0';
					q.push(node(i,j,k,0,0));//step和回合
					step[i][j]=k;
				}
			}
		}
		BFS();
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if(step[i][j]!=-1)ans[step[i][j]]++;
		}
	}
	for(int i=1;i<=p;i++){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn =1005;
char s[maxn][maxn];
int a[15];
int n,m,p;
int dir[4][2]={0,1,1,0,0,-1,-1,0};
int ans[15];
struct node{
	int x,y,id;
	node(int x,int y,int id):x(x),y(y),id(id){}
};
vector<node>v[15],tmp;
bool bfs(int id){
	tmp.clear();
	for(auto t:v[id])tmp.push_back(t);
	v[id].clear();
	for(auto t:tmp){
		for(int i=0;i<4;i++){
		int tx =t.x+dir[i][0];
		int ty =t.y+dir[i][1];
		if(tx<0||ty<0||tx>=n||ty>=m)continue;
		if(s[tx][ty]!='.')continue;
		s[tx][ty]=char(id+'0');
		v[id].push_back(node(tx,ty,id));
		}
	}
	if(!v[id].size())return false;
	else return true;
}
int main(){
	cin>>n>>m>>p;
	for(int i=1;i<=p;i++)scanf("%d",&a[i]);
	for(int i=0;i<n;i++){
		scanf("%s",s[i]);
		for(int j=0;j<m;j++){
			if(s[i][j]!='.'&&s[i][j]!='#'){
				int k = s[i][j]-'0';
				v[k].push_back(node(i,j,k));
			}
		}
	}
	int flag;
	while(1){
		flag=0;
		for(int i=1;i<=p;i++){
			for(int j=1;j<=a[i];j++){
				if(!bfs(i))break;else flag=1;
			}
		}
		if(!flag)break;
	}
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if(s[i][j]!='#')ans[s[i][j]-'0']++;
		}
	}
	for(int i=1;i<=p;i++){
		cout<<ans[i]<<" ";
	}
	return 0;
}