jiahuimbzuai/CoQuIR huggingface dataset:
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	var wtr = bufio.NewWriter(os.Stdout)
	var scanner = bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanLines)
	var N, M, C int
	if scanner.Scan() {
		str := scanner.Text()
		cols := strings.Split(str, " ")
		N, _ = strconv.Atoi(cols[0])
		M, _ = strconv.Atoi(cols[1])
		C, _ = strconv.Atoi(cols[2])
	}

	B := make([]int, M)
	if scanner.Scan() {
		str := scanner.Text()
		cols := strings.Split(str, " ")
		for j := 0; j < M; j++ {
			B[j], _ = strconv.Atoi(cols[j])
		}
	}

	var sum int
	for i := 0; i < N; i++ {
		var F int
		if scanner.Scan() {
			str := scanner.Text()
			cols := strings.Split(str, " ")
			for j := 0; j < M; j++ {
				a, _ := strconv.Atoi(cols[j])
				F += B[j] * a
			}
			F += C
		}
		if F > 0 {
			sum++
		}

	}

	fmt.Fprintln(wtr, sum)
	_ = wtr.Flush()
}
//  [go]
package main

import "fmt"

func main() {
	var n, m, a, b, c int
	fmt.Scan(&n, &m, &c)
	sum, count := 0, 0
	gm := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&b)
		gm[i] = b
	}
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			fmt.Scan(&a)
			sum = sum + a*gm[j]
		}
		if sum+c > 0 {
			count++
			sum = 0
		}
		sum = 0
	}
	fmt.Print(count)
}
//  [go]
package main

import "fmt"

func main() {
	var n, m, c int
	var ans = 0
	fmt.Scan(&n, &m, &c)
	b := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&b[i])
	}
	a := make([]int, m)
	for i := 0; i < n; i++ {
		for j := 0; j < m; j++ {
			fmt.Scan(&a[j])
		}

		sum := 0
		for k, _ := range a {
			sum += a[k] * b[k]
		}
		if sum+c > 0 {
			ans++
		}

	}
	fmt.Println(ans)
}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Can you solve this?
	var N, M, C int
	fmt.Scanf("%d %d %d", &N, &M, &C)

	B := make([]int, M)
	for i := 0; i < M; i++ {
		fmt.Scanf("%d", &B[i])
	}

	var A, sum, answer int
	for j := 0; j < N; j++ {
		sum = 0
		for i := 0; i < M; i++ {
			fmt.Scanf("%d", &A)
			sum += A * B[i]
		}
		sum += C
		if sum > 0 {
			answer++
		}
	}
	fmt.Println(answer)
}
//  [ruby]
n, _, c = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)
res = 0
n.times do |_|
  a = gets.chomp.split.map(&:to_i)
  res += 1 if a.zip(b).map {|i, j| i * j }.inject(:+) + c > 0
end
puts res
//  [ruby]
# abc121 B
n, m, c = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)

A = n.times.map do
  gets.split.map(&:to_i)
end

p A.count { |as|
  r = as.map.with_index { |a, i|
    a * b[i]
  }.inject(:+) + c
  r > 0
}
//  [ruby]
n,m,c = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)
count = 0
n.times do
  a = gets.split.map(&:to_i)
  sum = 0
  m.times do |i|
    sum += a[i] * b[i]
  end
  if sum + c > 0
    count += 1
  end
end
puts count
//  [ruby]
require 'matrix'
N = gets.split.map &:to_i
B = Vector.elements(gets.split.map(&:to_i), false)
ans = 0
N[0].times {
  ans += Vector.elements(gets.split.map(&:to_i), false).dot(B) + N[2] > 0 ? 1 : 0
}
p ans
//  [ruby]
n,m,c=gets.chomp.split(" ").map(&:to_i);

b=gets.chomp.split(" ").map(&:to_i);

a=[]

1.upto(n) do |i|
  a[i]=gets.chomp.split(" ").map(&:to_i);
end

answer = 0

def func1 b,a,c

  sum = 0
  b.each_with_index do |b1,i|
    sum+=b1*a[i]
  end
  sum += c
end

1.upto(n) do |i|
  if func1(b,a[i],c) > 0 
    answer+=1
  end
end


print answer
//  [ruby]
n,m,c = gets.chomp.split(' ').map(&:to_i)
b = gets.chomp.split(' ').map(&:to_i)
ans = 0

n.times do |i|
  sum = 0
  j = 0
  as = gets.chomp.split(' ').map(&:to_i)
  as.each do |a|
    sum+=a*b[j]
    j+=1
  end
  ans += 1 if sum+c > 0
end
puts ans
//  [rust]
use std::io;

fn can_solve(av: &Vec<i32>, bv: &Vec<i32>, c: i32) -> bool {
    av.iter().zip(bv.iter()).map(|(a, b)| a * b).sum::<i32>() + c > 0
}

#[test]
fn test_can_solve_1() {
    assert!(!can_solve(&vec![3, 2, 1], &vec![1, 2, 3], -10));
    assert!(can_solve(&vec![1, 2, 2], &vec![1, 2, 3], -10));
}

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let mut iter = input.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let m: usize = iter.next().unwrap().parse().unwrap();
    let c: i32 = iter.next().unwrap().parse().unwrap();
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let mut iter = input.split_whitespace();
    let bv: Vec<i32> = (0..m).map(|_| { iter.next().unwrap().parse().unwrap() }).collect();
    let mut a_matrix: Vec<Vec<i32>> = Vec::with_capacity(n);
    for _ in 0..n {
        let mut input = String::new();
        io::stdin().read_line(&mut input).unwrap();
        let mut iter = input.split_whitespace();
        let av: Vec<i32> = (0..m).map(|_| { iter.next().unwrap().parse().unwrap() }).collect();
        a_matrix.push(av);
    }
    let count = a_matrix.iter().filter(|av| { can_solve(av, &bv, c) }).count();
    println!("{}", count);
}
//  [rust]
#![allow(dead_code, unused_variables, unused_macros, unused_imports)]

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
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)*} }; ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => { let mut $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 main() {
    input! {
        n: usize,
        m: usize,
        c: i32,
        b: [i32; m],
        a: [[i32; m]; n],
    }

    let mut ans = 0;
    for i in 0..n {
        let sum = a[i].iter().zip(b.iter()).map(|(a, b)| a * b).sum::<i32>() + c;
        if sum > 0 {
            ans += 1;
        }
    }
    println!("{}", ans);
}
//  [rust]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn adjacent4(x: usize, y: usize, sx: usize, sy: usize) -> Vec<(usize, usize)> {
    [(-1, 0), (1, 0), (0, -1), (0, 1)]
        .into_iter()
        .filter_map(|&(dx, dy)| {
            let nx = x as isize + dx;
            let ny = y as isize + dy;
            if nx >= 0 && nx < sx as isize && ny >= 0 && ny < sy as isize {
                Some((nx as usize, ny as usize))
            } else {
                None
            }
        })
        .collect()
}

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
fn main() {
    input! {
        n: usize,
        m: usize,
        c: isize,
        b: [isize; m],
        a: [[isize; m]; n],
    }
    let mut count = 0;
    for i in 0..n {
        let mut ret = 0;
        for j in 0..m {
            ret += a[i][j] * b[j];
        }
        if ret + c > 0 {
            count += 1;
        }
    }
    println!("{}", count);
}
//  [rust]
use proconio::input;

#[allow(unused_variables)]
fn main() {
    input! {
      n: usize, m: usize, c: isize,
      ba: [isize; m],
      mut aa: [[isize; m]; n]
    };

    let mut ans = 0;

    for i in 0..n {
        let mut sum = 0;
        for j in 0..m {
            sum += &aa[i][j] * &ba[j];
        }

        if sum + c > 0 {
            ans += 1;
        }
    }

    println!("{}", ans);
}
//  [rust]
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        c: i32,
        b: [i32; m],
    };

    let mut count = 0;
    for _ in 0..n {
        input! {
            a: [i32; m],
        };

        let a: Vec<i32> = a;

        let mut sum: i32 = 0;
        for (ai, bi) in a.iter().zip(b.iter()) {
            sum += ai * bi;
        }
        sum += c;

        if sum > 0 {
            count += 1;
        }
    }

    println!("{}", count);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        n: usize, m: usize, c: i64,
        b: [i64; m],
        a: [[i64; m]; n],
    }

    let mut ret = 0;
    for i in 0..n {
        let ai = &a[i];
        let mut total = 0;
        for j in 0..m {
            total += ai[j] * b[j];
        }
        total += c;
        if total > 0 {
            ret += 1;
        }
    }
    println!("{}", ret);
}
//  [swift]
import Foundation

extension String {
    func split(separator: String) -> [Int] {
        return self.componentsSeparatedByString(separator).map { Int($0)! }
    }
}

let input = readLine()!.split(" ")
let N = input[0]
let M = input[1]
let C = input[2]
let B = readLine()!.split(" ")

var ans = 0
for _ in 0..<N {
    let A = readLine()!.split(" ")
    var sum = 0
    for i in 0..<M {
        sum += A[i] * B[i]
    }
    if sum + C > 0 {
        ans += 1
    }
}

print(ans)
//  [swift]
import Foundation

let NMC = readLine()!.components(separatedBy: " ")

let N = Int(NMC[0])!
let M = Int(NMC[1])!
let C = Int(NMC[2])!

let B = readLine()!.components(separatedBy: " ").map { Int($0)! }

func passes(_ A: Array<Int>) -> Bool {
    var sum = 0
    for i in 0..<M {
        sum += A[i]*B[i]
    }
    sum += C
    return sum > 0
}


var ret = 0

for _ in 0..<N {
    let A = readLine()!.components(separatedBy: " ").map { Int($0)! }
    // print(A, B, passes(A))
    if passes(A) {
        ret += 1
    }
}

print(ret)
//  [typescript]
const main = (input) => {
  const lines = input.trim().split("\n")
  const [N, M, C] = lines[0].split(" ").map(str => parseInt(str));
  const B = lines[1].split(" ").map(str => parseInt(str));
  let A = lines.slice(2).map(line => line.split(" "));

  // const answer = A.reduce((cnt, a) => cnt + (a.reduce((acc, cur, i) => acc += cur * B[i], C) > 0), 0)
  const answer = A.filter(a =>
    a.reduce((acc, cur, i) => acc + cur * B[i], C) > 0
  ).length;
  console.log(answer);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [typescript]

const solve = (c, blist, alist) => {
  // ...
  let result = 0
  alist.map((as) => {
    const m = as
      .map((a, i) => {
        return a * blist[i]
      })
      .reduce((curr, next) => {
        return curr + next
      }, 0)
    if (m + c > 0) {
      result++
    }
  })
  return result
}

const main = (input) => {
  const [head, b, ...as] = input.split("\n")
  const [n, m, c] = head.split(" ").map(Number)
  const blist = b.split(" ").map(Number)
  const alist = as.map((a) => {
    return a.split(" ").map(Number)
  })

  return solve(c, blist, alist)
}

if (process.env.NODE_ENV !== "test") {
  const input = require("fs").readFileSync("/dev/stdin", "utf8")
  console.log(main(input.trim()))
}
//  [typescript]
function readInt(str){
    return parseInt(str, 10);
}
function range(begin, end){
    if(begin > end) return range(end, begin).reverse();
    const ans=[];
    for(let i=begin; i<=end; i++){
        ans.push(i);
    }
    return ans;
}

function solve(N,W,C,B,A:number[][]){
    return A.map((a,n)=>
        a.map((value,index)=>value*B[index])
        .reduce((prev,cur)=>prev+cur,0)+C>0?1:0
    ).reduce((prev,cur)=>prev+cur,0);
}
function Main(raw:string) {
    const input = raw.split("\n");
    const [N, W, C] = input[0].split(" ").map(readInt);
    const B = input[1].split(" ").map(readInt);
    const A=[];
    for(let i=0; i < N ;i++){
        A[i] = input[i+2].split(" ").map(readInt);
    }

    
    //出力
    console.log("%d", solve(N,W,C,B,A));
}

//DO NOT EDIT
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length === 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public async getNumbers(): Promise<number[]> {
      return (await this.getLine()).split(' ').map((x) => +x);
    }

    public async getStrings(): Promise<string[]> {
      return (await this.getLine()).split(' ');
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function solve() {
    const sc = new Scanner();
    const [N, M, C]: number[] = await sc.getNumbers();
    const B: number[] = await sc.getNumbers();
    const A: number[][] = [];
    for (let i = 0; i < N; i += 1) {
      A.push(await sc.getNumbers());
    }
    let ans = 0;
    for (let i = 0; i < N; i += 1) {
      let t = C;
      for (let j = 0; j < M; j += 1) {
        const tA = A[i][j];
        const tB = B[j];
        t += tA * tB;
      }
      if (t > 0) ans += 1;
    }
    console.log(ans);
    sc.close();
  }

  solve();
}
//  [typescript]
import * as fs from 'fs';

const lines = fs.readFileSync('/dev/stdin', 'utf8').split('\n');

const [N, M, C] = lines[0].split(' ').map(Number);
const B = lines[1].split(' ').map(Number);
let answer = 0;

for(let i=2; i<N+2; i++) {
	let A = lines[i].split(' ').map(Number);
	if (A.map((a, i) => {return a*B[i]}).reduce((a, b) => {return a+b}, 0)+C > 0) {
		answer += 1;
	}
}

console.log(answer);
//  [typescript]
const input = require('fs').readFileSync('/dev/stdin', 'utf8');

const nmc = input.split('\n')[0].split(' ');
const bArray = input.split('\n')[1].split(' ');

const aArray = input.split('\n');
let ansCnt = 0;
for (let i = 0; i < nmc[0]; i++) {
    let sum = 0;
    let a = aArray[i + 2].split(' ');

    for (let j = 0; j < nmc[1]; j++) {
        sum += a[j] * bArray[j];
    }

    sum += Number(nmc[2]);
    if (sum > 0) { ansCnt++; }
}

console.log(ansCnt)
//  [python]
# -*- coding: utf-8 -*-
"""
Created on Sun Dec  2 20:06:44 2018

@author: Owner
"""

import collections
import scipy.misc
import sys
import numpy as np
import math
from operator import itemgetter

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())

P = [0]*M
Y = [0]*M
for m in range(M):
    P[m], Y[m] = map(int, input().split())
"""

S = input()

len_S = len(S)
s_list = []

for n in range(len_S):
    s_list.append(int(S[n]))

min753 = 10000

for n in range(len_S-2):
    temp_diff = abs(100*s_list[n] + 10*s_list[n+1] + s_list[n+2] - 753)
    if temp_diff < min753:
        min753 = temp_diff
        if min753 == 0:
            break
        

print(min753)
//  [python]
import numpy as np
n = input()
l = len(n)
a = np.array([int(n[i:i+3]) for i in range(l-2)])
x = np.abs(a-753)
print(np.min(x))
//  [python]
def main():
	import numpy as np
	min = -1
	s = input()
	n = len(s)
	for i in range(n-2):
		buf = int(s[i:i+3])
		bufmin = np.abs(buf-753)
		if(min == -1):
			min = bufmin
		else:
			if(bufmin < min):
				min = bufmin
	print(min)

main()# your code goes here
//  [java]
import java.util.*;
import java.util.stream.*;

class Main{
	public static void main(String[] $){
		Scanner s=new Scanner(System.in);
		String v=s.next();
		System.out.println(IntStream.range(0,v.length()-2)
				.map(i->Math.abs(753-Integer.parseInt(v.substring(i,i+3))))
				.min().getAsInt());
	}
}
//  [java]

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {

	static int[] num;
	final static int AB = 753;
	public static void main(String[] args) throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			num = Arrays.stream(br.readLine().split("")).mapToInt(Integer::parseInt).toArray();
			int min = 999;
			for(int i=0; i<num.length-2; i++) {
				String r = String.valueOf(num[i]);
				r += String.valueOf(num[i+1]);
				r += String.valueOf(num[i+2]);
				int iii = Math.abs(Integer.parseInt(r) - AB);
				if(iii < min) min = iii;
			}
			System.out.println(min);
		}
	}

}
//  [java]
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.*;

public class Main implements Runnable {

    public static void main(String[] args) throws Exception {
        Thread.setDefaultUncaughtExceptionHandler((t, e)->System.exit(1));
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();
    }

    public void run() {
        String S = null;
        // 入力
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            S = br.readLine();
        } catch (Exception e) {
            e.printStackTrace();
        }

        int min = 10000; // 与えられた文字列から切り出した3桁の数値と753の差の絶対値の最小値

        for (int i = 0; i < S.length() - 2; i++) {
            // 3文字取り出す
            String temp = S.substring(i, i + 3);
            // 数値にする
            int temp2 = Integer.parseInt(temp);
            // 差の絶対値を取得する
            // 最小値の更新処理
            min = Math.min(min, Math.abs(temp2 - 753));
        }
        // 出力
        System.out.println(min);
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(void){
    string n;
    cin >> n;
    int min = 100000000;
    for(int i=0;i<=n.size()-3;++i){
        string ss = n.substr(i, 3);
        int n = atoi(ss.c_str());
        if(min > abs(n-753)) min = abs(n-753);
    }
    cout << min << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
 
  string s;
  cin>>s;
  int ans=10000;
  int n=s.size();
  rep(i,n-2){
    int sub=stoi(s.substr(i,3));
    int diff=abs(753-sub);
    if(diff<ans)ans=diff;
  }
  cout(ans);
  return 0;
}
//  [cpp]
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
int main(){
  string a;cin>>a;
  ll b,c,d,e=INT_MAX;
  rep(i,a.size()-2){
    b=(a[i]-'0')*100;
    c=b+(a[i+1]-'0')*10;
    d=c+(a[i+2]-'0');
    e=min(e,abs(d-753));
  }
  cout<<e;
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include <string.h>
#include<math.h>

int main(){

char S[11];
int S_num[10];
int X,min=1000;
scanf("%s",S);
for (int i = 0; i < strlen(S); i++)
{
    S_num[i] = (int)S[i]-48;
}

for (int i = 0; i < strlen(S)-2; i++)
{
    int diff = 0;
    X = S_num[i]*100+S_num[i+1]*10+S_num[i+2];
    diff = abs(X-753);
    if(min>diff){min = diff;}
}

printf("%d",min);
return 0;
}
//  [c]
#include<stdio.h>
int main(){
	long s;int i,d,min=999;
	scanf("%ld",&s);
	for(i=0;i<8;i++){
	d=abs(s%1000-753);
	min=(min>d?d:min);
	s/=10;
	}
printf("%d",min);
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

char *trichrjoin(char a, char b, char c)
{
  int i = 0;
  char *s;
  s = (char *)malloc(sizeof(char)*(4));
  s[0] = a;
  s[1] = b;
  s[2] = c;
  s[3] = '\0';
  return (s);
}

int main()
{
  char s[11];
  scanf("%s",&s);
  int i = 0;
  char *buf = 0;
  char *tmp = 0;
  int num = 0;
  int diff = 0;
  int min = 1000;
  while (s[i+2])
  {
    tmp = buf;
    buf = trichrjoin(s[i], s[i+1], s[i+2]);
    free(tmp);
    num = atoi(buf);
    diff = abs(num - 753);
    if (diff < min)
      min = diff;
    i++;
  }
  printf("%d",min);
  
}
//  [javascript]
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	var s = toIntArr(input[0].split(''));
	var l = s.length;
	var ans = 100000;
	var x = 0;
	for(var i = 0; i < l-2; i++){
		x = s[i]*100 + s[i+1]*10 + s[i+2];
		x = abs(x - 753);
		if(ans > x) ans = x;
	}
	if(ans == 0) ans = 0;
	
	console.log(ans);
}
//  [javascript]
function Main(input){
	input = input.split("\n")[0];
  var len = input.length;
  var min = 1000;
  for(var i = 0; i < len - 2; i++){
  	var a = ~~input[i];
    var b = ~~input[i+1];
    var c = ~~input[i+2];
    var abs = a*100 + b*10 + c - 753;
    if(abs < 0)abs *= -1;
    if(abs < min)min = abs;
  }
  return min;
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
1234567876
`);
//  [javascript]
function Main(input) {
  input = input.split("\n");
  S= input[0].split("");
  var ans=999;
  for(i=0;i<S.length-2;i++){
    ans=Math.min(ans,Math.abs(753-parseInt(S[i]+S[i+1]+S[i+2])));
  }

  console.log('%s', ans);
}
  
// "実行する"ボタンを押した時に実行される関数 (デバッグ用)
function debug(){
  var input = document.getElementById("input").value;
  Main(input);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()

	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextInt64() int64 {
	sc.Scan()

	i, e := strconv.ParseInt(sc.Text(), 10, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func nextF64() float64 {
	sc.Scan()

	i, e := strconv.ParseFloat(sc.Text(), 64)
	if e != nil {
		panic(e)
	}
	return i
}
func f(x int) int {
	if x == 1 {
		return 1
	}
	return f(x/2)*2 + 1
}

func main() {
	sc.Split(bufio.ScanWords)
	s := strings.Split(nextLine(), "")

	low := 0
	high := math.MaxInt32
	num := 753
	for i := 2; i < len(s); i++ {
		val, _ := strconv.Atoi(s[i-2] + s[i-1] + s[i])
		if num > val && val > low {
			low = val
		} else if num < val && val < high {
			high = val
		} else if num == val {
			fmt.Println(0)
			return
		}
	}
	if num-low > high-num {
		fmt.Println(high - num)
	} else {
		fmt.Println(num - low)
	}

}
//  [go]
package main

import (
	"fmt"
	"strconv"
)

func main() {
	var s string
	fmt.Scan(&s)

	ans := int(1e12)
	for i := 0; i <= len(s)-3; i++ {
		a, _ := strconv.Atoi(s[i : i+3])
		ans = min(ans, abs(753-a))
	}
	fmt.Println(ans)
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
//  [ruby]
s=gets.chomp
ans=753
for i in 0..s.size-3
  ans=[ans,(753-(s[i]+s[i+1]+s[i+2]).to_i).abs].min
end
puts ans
//  [ruby]
S = gets.strip.to_s
n = S.size
ary = []
(0..n-3).each do |x|
  ary.unshift(((S.slice(x..x+2).to_i)-753).abs)
end
puts ary.min
//  [ruby]
S = gets.chomp
ans = 1000
LOVE_NUMBER = 753
for i in 0..S.length-3 do
    x = (S[i] + S[i+1] + S[i+2]).to_i
    ans = [ans, (LOVE_NUMBER - x).abs].min
end

p ans
//  [rust]
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    unused_imports,
    dead_code
)]
//use proconio::fastout;
use proconio::input;
use proconio::marker::*;
//use std::collections::HashSet;
use std::cmp::*;
//use std::collections::VecDeque;

fn main() {
    input! {
      mut S:i64
    }
    let mut ans = 999;

    while S >= 100 {
        let a = S % 1000;
        ans = min(ans, (a - 753).abs());
        S = S / 10;
    }
    println!("{}", ans);
}
//  [rust]
use std::cmp::min;
use std::io::*;
use std::str::FromStr;

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

fn main() {
    let s:Vec<char> = read::<String>().chars().collect();
    let ln = s.len();
    let mut ans = 753i64;
    for i in 0..ln-2 {
        let tmp =
                (s[i].to_digit(10).unwrap() * 100
            + s[i+1].to_digit(10).unwrap() * 10
            + s[i+2].to_digit(10).unwrap()) as i64;
        ans = min(ans, (753-tmp).abs());
    }
    println!("{}", ans);
}
//  [rust]
use proconio::input;

fn main() {
    input! {
        s: String,
    }
    let s = s
        .chars()
        .collect::<Vec<_>>()
        .iter()
        .map(|x| x.to_digit(10).unwrap() as i64)
        .collect::<Vec<_>>();
    let mut mi = i64::max_value();
    for i in 0..s.len() - 2 {
        let n = s[i] * 100 + s[i + 1] * 10 + s[i + 2];
        if (n - 753).abs() < mi {
            mi = (n - 753).abs();
        }
    }
    println!("{}", mi);
}
//  [swift]
import Foundation

let s = readLine()!
var ans = 999
for i in 0..<s.count-2 {
  let from = s.index(s.startIndex, offsetBy: i)
  let to = s.index(from, offsetBy: 2)
  let sub = String(s[from...to])
  ans = min(ans, abs(753 - Int(sub)!))
}
print(ans)
//  [python]
import numpy as np
a = len([n for n in range(1,int(input())+1) if ((np.log10(n)+1)//1)%2!=0])
print(a)
//  [python]
import numpy as np
N=int(input())
#N以下の正の整数の文字列を生成



list_a=np.arange(1, N+1)
list_b =[]


#print(list_a)
#print(len(str(list_a)))

for i in list_a:
    if  len(str(i))%2 !=0:
        #print(i)
        list_b.append(i)

print(len(list_b))
//  [python]
N=int(input())
#a,b,c=map(int, input().split())
import numpy as np
a=np.arange(1,N+1)
cnt=0
for n in a:
    if len(str(n))%2==1:
        cnt+=1
    else:
        pass
print(cnt)
//  [java]
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        int n = Integer.parseInt(str);
        sc.close();
        int flag =0;
        for(int i=1;i<=n;i++){
            flag += check(Integer.toString(i));
        }
        System.out.println(flag);
    }

    public static int check(String a){
        String[] tmp = a.split("");
        if(tmp.length %2 == 0){
            return  0;
        }
        else{
            return 1;
        }
    }
}
//  [java]
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 地点数の入力
		int n = sc.nextInt();

		int result = 0;

		for (int i = 1; i <= n; i++) {
			String[] iStr = String.valueOf(i).split("");

			if (iStr.length%2==1) result++;
		}

		System.out.println(result);

	}}
//  [java]
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		String nStr = String.valueOf(N);
		
		int ans = 0;
		
		for(int i = 1; i <= N; i ++) {
			String str = String.valueOf(i);
			String[] len = str.split("");
			if(len.length % 2 == 1) {
				ans++;
			}
		}
		System.out.println(ans);
	}

}
//  [cpp]
#include <iostream>
#include <boost/format.hpp>
#include <algorithm>
using namespace std;

int KetaCount(int Num){
    string tmp = (boost::format("%1%") % Num).str();
    return (int)(tmp.length());
}

int main(void){
    int N;
    int GetKeta;
    int cnt = 0;
    cin >> N;

    for(int i=1; i<=N; i++){
        GetKeta = KetaCount(i);
        if(GetKeta%2 == 1) cnt++;
    }
    cout << cnt <<endl;
    return 0;
}
//  [cpp]
#include <iostream>
#include <sstream>

using namespace std;

int main () {
    int n; cin >> n;
    int ans = 0;
    for (int i = 1; i <= n; i++ ){
        stringstream ss;
        string tmp;
        ss << i;
        ss >> tmp;
        if (tmp.size() % 2 == 1) {
            ans++;
        }
    }
    cout << ans << endl;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace  std ;
typedef long l ;
typedef long long ll ;
typedef vector<int>vi ;
typedef vector<l>vl ;
typedef vector<ll>vll ;
typedef vector<vector<int> >vii ;
typedef pair<int,int> pi ;
int main()
{
    ll a,b,i,j,n,c,d,k,t,m,q,x,y;
    cin>>n ;
  c = 0 ;
  for(i=1 ; i<=n ; i=i+1)
  {
    stringstream temp ;
    temp<<i ;
    string str;
    temp>>str ;
    if(str.size()%2)
    {
      c++ ;
    }
  }
  cout<<c ;
}
//  [c]
#include <stdio.h>

main() {
	char s[7];
	int N, i, cnt;
    cnt = 0;
	scanf("%d", &N);

	for (i = 1; i <= N; ++i) {
		if (sprintf(s, "%d", i) % 2 == 1) {
			cnt ++;
		}
	}
	printf("%d\n", cnt);
}
//  [c]
#include <stdio.h>

main() {
	char s[7];
	int N, i, cnt = 0;

	scanf("%d", &N);

	for (i = 1; i <= N; cnt += sprintf(s, "%d", i++) % 2);

	printf("%d\n", cnt);
}
//  [c]
#include <stdio.h>
main() {
	char s[7];
	int N, i, cnt = 0;
	scanf("%d", &N);
	for (i = 1; i <= N; cnt += sprintf(s, "%d", i++) % 2);
	printf("%d\n", cnt);
}
//  [javascript]
//↓見なくていいよ！ここから--------------------------------------------------
var read = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
var obj;
var inLine = [];
read.on('line', function(input){inLine.push(input);});
read.on('close', function(){
  obj = init(inLine);
  console.error("\n");
  var start = Date.now();
  Main();
  var end = Date.now() - start;
  myerr("time : " + (end) + "ms");
  myerr("memory : " + Math.round(process.memoryUsage().heapTotal / 1024) + "KB");
});
function makeClone(obj){return JSON.parse(JSON.stringify(obj));}
function nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}
function nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}
function next(){return obj.next();} function hasNext(){return obj.hasNext();}
function init(input){  
  var returnObj = {
    list : input, index : 0, max : input.length,
    hasNext : function(){return (this.index < this.max);},
    next : function(){if(!this.hasNext()){throw "ArrayIndexOutOfBoundsException これ以上ないよ";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}
  };
  return returnObj;
}
function myout(s){console.log(s);}
function myerr(s){console.error("debug:" + require("util").inspect(s,false,null));}
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す 1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map(Number);case 6:return i.split("");case 7:return i.split("").map(Number);case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}

//↑見なくていいよ！ここまで--------------------------------------------------
function Main(){
	var N = nextInt();
	var output = 0;
	for(var i = 1; i <= N; i++){
		var tmp = i.toString();
		if(tmp.length % 2 == 1){
			output++;
		}
	}
	myout(output);
}
//  [javascript]
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

console.log(main());
function main(){
  var n = o.a();
  var ans = 0;
  for(var i = 1; i <= n; i++){
    if(f(i))ans++;
  }
  return ans;
}

function f(n){
  if(n<10)return 1;
  if(n<100)return 0;
  if(n<1000)return 1;
  if(n<10000)return 0;
  if(n<100000)return 1;
  return 0;
}
//  [javascript]
module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){r(1)(r(2).readFileSync("/dev/stdin","UTF-8"))},function(e,t){e.exports=function(e){for(var t=e.split("\n"),r=Number(t[0]),n=0,o=0,u=r,i=.1;u>0;)o+=1,i*=10,u=Math.floor(u/10);n+=[0,9,9,909,909,90909][o-1],o%2==1&&(n+=r-i+1),console.log(n)}},function(e,t){e.exports=require("fs")}]);
//  [go]
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func digits(n int) int {
	s := strconv.Itoa(n)
	return len(strings.Split(s, ""))
}

func isOdd(n int) bool {
	if n%2 == 1 {
		return true
	}
	return false
}

func main() {
	var n int
	fmt.Scan(&n)

	var result int
	for ; 0 < n; n-- {
		if isOdd(digits(n)) {
			result++
		}
	}
	fmt.Println(result)
}
//  [go]
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var n int
	fmt.Scan(&n)

	ans := 0
	for i := 1; i <= n; i++ {
		sn := strconv.Itoa(i)
		sliceN := strings.Split(sn, "")
		if len(sliceN)%2 != 0 {
			ans++
		}
	}

	fmt.Print(ans)
}
//  [go]
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var n int
	fmt.Scan(&n)

	ans := 0
	for i := 1; i <= n; i++ {
		str := strings.Split(strconv.Itoa(i),"")
		if len(str) % 2 != 0 {
			ans++
		}
	}
	fmt.Println(ans)
}
//  [ruby]
n = gets.to_i
count = 0

for i in 1..n do
if i.to_s.split("").length % 2 == 1
count += 1
end
end

print(count)
//  [ruby]
n = gets.to_i
cnt = 0

1.upto(n).to_a.each{ |t|
 if t.to_s.split("").count % 2 == 1
   cnt += 1
 end
  }

p cnt
//  [ruby]
def is_odd?(value)
  value.to_s.split('').length.odd?
end

n = gets.chomp.to_i
counter = 0

(1..n).each do |v|
  counter +=1 if is_odd?(v)
end

print counter
//  [rust]
use std::io;

fn main() {
    let stdin = io::stdin();

    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();
    let num: usize = buf.trim().parse().unwrap();

    let mut keta = 0;

    for i in 1..(num + 1) {
        if (i.to_string().len() == 1 || i.to_string().len() == 3 || i.to_string().len() == 5) {
            keta += 1;
        }
    }

    println!("{}", keta);
}
//  [swift]
import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * { }
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}
let MOD = 10**9+7

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

let N = readInt()!
var ans = 0
for i in 1...N {
    if String(i).count % 2 > 0 {
        ans += 1
    }
}
print(ans)
//  [swift]
print((1...Int(readLine()!)!).reduce(0){$0+(String($1).characters.count%2>0 ?1:0)})
//  [swift]
print((1...Int(readLine()!)!).reduce(0){$0+String($1).characters.count%2})
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const n: number = +input[0];

let ans: number = 0;

for(let i = 1; i <= n; i++){
    const li: string[] = String(i).split('');
    if (li.length % 2 !== 0){
        ans++;
    }
}
console.log(ans);
//  [typescript]
{
  const Main = (input: string) => {
    let count = 0;

    const inputArray: string[] = input.split(/ |\n/);
    const N: number = parseInt(inputArray[0]);
    for (let i = 1; i < N + 1; i++) {
      if (i.toString().length % 2 === 1) {
        count++;
      }
    }
    console.log(count);
    
  }
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}
//  [typescript]
const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.n())}return a}else{const a=t.input[0];t.input.shift();return Number(a)}},s:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.s())}return a}else{const a=t.input[0];t.input.shift();return String(a)}},c:(arg:number=0):any=>{if(arg){const a=[];for(let i=0;i<arg;i++){a.push(t.c())}return a}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('')}else{t.input.shift()}return String(b)}},o:(...arg)=>{console.log(...arg)},abs:(a)=>{return Math.abs(a)},min:(...a)=>{return Math.min(...a)},max:(...a)=>{return Math.max(...a)},floor:(a)=>{return Math.floor(a)},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b})},desc:(ar:number[])=>{return ar.sort((a,b)=>{return b-a})},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1];}return arr[arr.length-1]}};
const main=()=>{
  let n=t.n()
  let c=0;
  for(let i=1;i<=n;i++){
    if(String(i).length%2!=0)c++;
  }
  t.o(c)
}
main()
//  [python]
def compound_interest(n, r, t): 
    for i in range(t):
        n=n+int((n*r)/100)
    return n

x=int(input())
for i in range (1,100000):
    ci=compound_interest(100, 1, i)
    if(ci>=x):
        print(i)
        break
//  [python]
import math
X=int(input())
def an(n,r=1.01):
  a=100
  for i in range(1,n+1):
     a=math.floor(a*r)
  return a

for n in range(1,10**8):
  if X<=an(n):
    print(n)
    break
//  [python]
X = int(input())

import math

# n年後のお金
def calcX(n):
  X = 100
  for i in range(n):
    X = math.floor(X * 1.01)
  return X

year = 0
while True:
  if X > calcX(year):
    year += 1
  else:
    print(year)
    break
//  [java]
import java.util.*;

public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        long x = scan.nextLong();
        long b = 100;
        int out = 0;
        while(b < x){
            b += b / 100;
            out++;
        }
        System.out.println(out);
    }

    public static void main(String[] args){
        new Main().solve();
    }
}
//  [java]
import java.util.*;

public class Main {
    public static void main(String[] args) {
        long count =0;
        long kazu=0;
        long number=100;
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        long n=Long.parseLong(a);
        while (true){
          number=(long)(1.01*number);
          //System.out.println(number);
          count++;
          if(number>=n){
              break;
          }
        }
        System.out.println(count);
    }
}
//  [java]
import java.util.*;
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    long x = sc.nextLong();
    long n=100;
    int i=1;
    for(i=0;n<x;i++){
      n=(long)(n*1.01);
    }
    pl(i+"");
  }

  public static int aa(int n){
    if(n>0){return 1;}
    return 0;
  }

  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
}