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

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

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

func condAB(c bool, a, b int) int {
	if c {
		return a
	}
	return b
}

func check(N int) int {
	ans := 0
	for i := 0; i < N; i++ {
		n := i
		var x, x3, x5, x7 int
		for n > 0 {
			if n%10 == 3 {
				x3 = 1
			}
			if n%10 == 5 {
				x5 = 1
			}
			if n%10 == 7 {
				x7 = 1
			}
			if n%10 != 3 && n%10 != 5 && n%10 != 7 {
				x = 1
			}
			n /= 10
		}
		if x3+x5+x7 == 3 && x == 0 {
			ans++
		}
	}
	return (ans)
}

func main() {
	sc.Split(bufio.ScanWords)

	N := getInt()

	n := N
	nbits := 0
	d := make([]int, 0)
	for n > 0 {
		d = append([]int{n % 10}, d...)
		n /= 10
		nbits++
	}

	//  [digit][smaller][cond1][cond2][cond3]
	//  cond1 ... 3で含む
	//  cond2 ... 5を含む
	//  cond3 ... 7を含む
	//  cond4 ... 375以外を含む
	//  cond5 ... 0より大きい
	var dp [15][2][2][2][2][2][2]int

	dp[0][0][0][0][0][0][0] = 1
	for i := 0; i < nbits; i++ {
		for m := 0; m < 2; m++ {
			for j3 := 0; j3 < 2; j3++ {
				for j5 := 0; j5 < 2; j5++ {
					for j7 := 0; j7 < 2; j7++ {
						for z := 0; z < 2; z++ {
							for n357 := 0; n357 < 2; n357++ {
								for a := 0; a <= condAB(m != 0, 9, d[i]); a++ {
									mm := m
									if a < d[i] {
										mm = 1
									}
									jj3 := j3
									if a == 3 {
										jj3 = 1
									}
									jj5 := j5
									if a == 5 {
										jj5 = 1
									}
									jj7 := j7
									if a == 7 {
										jj7 = 1
									}
									nn357 := n357
									if z == 1 {
										if a != 3 && a != 5 && a != 7 {
											nn357 = 1
										}
									} else {
										if a != 0 && a != 3 && a != 5 && a != 7 {
											nn357 = 1
										}
									}
									zz := z
									if a > 0 {
										zz = 1
									}
									dp[i+1][mm][jj3][jj5][jj7][nn357][zz] += dp[i][m][j3][j5][j7][n357][z]
								}
							}
						}
					}
				}
			}
		}
	}

	ans := 0
	for m := 0; m < 2; m++ {
		for j3 := 0; j3 < 2; j3++ {
			for j5 := 0; j5 < 2; j5++ {
				for j7 := 0; j7 < 2; j7++ {
					for z := 0; z < 2; z++ {
						for n357 := 0; n357 < 2; n357++ {
							if j3 == 1 && j5 == 1 && j7 == 1 && n357 == 0 {
								ans += dp[nbits][m][j3][j5][j7][n357][z]
							}
						}
					}
				}
			}
		}
	}
	out(ans)
	//	out(check(N))
}
//  [go]
package main

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

func main() {
	n := getInt()

	candidate := [4]int{0, 3, 5, 7}
	count := 0
L:
	for _, c1 := range candidate {
		for _, c2 := range candidate {
			for _, c3 := range candidate {
				for _, c4 := range candidate {
					for _, c5 := range candidate {
						for _, c6 := range candidate {
							for _, c7 := range candidate {
								for _, c8 := range candidate {
									for _, c9 := range candidate {
										for _, c10 := range candidate {
											numsOf753 := [10]int{c1, c2, c3, c4, c5, c6, c7, c8, c9, c10}
											flags := map[int]bool{3: false, 5: false, 7: false}
											for _, v := range numsOf753 {
												flags[v] = true
											}
											if !flags[3] || !flags[5] || !flags[7] {
												continue
											}
											flag := true
											for i := 1; i < 10; i++ {
												if numsOf753[i] == 0 && numsOf753[i-1] != 0 {
													flag = false
													break
												}
											}
											if !flag {
												continue
											}

											x := 0
											for i, v := range numsOf753 {
												x += v * pow(10, 10-i-1)
											}
											if x > n {
												break L
											}

											count++
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}

	fmt.Println(count)
}

func pow(a, b int) int {
	x := float64(a)
	y := float64(b)
	return int(math.Pow(x, y))
}

// -----------------------------------------

var scanner = wordScanner()

func wordScanner() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}

func getInt() int {
	scanner.Scan()
	i, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func getIntSlice(n int) []int {
	is := make([]int, n)
	for i := range is {
		is[i] = getInt()
	}
	return is
}

func getString() string {
	scanner.Scan()
	s := scanner.Text()
	return s
}
//  [ruby]
$n = gets.chomp

n_size = $n.size

$n = $n.to_i

count = 0

def factorial(number)
  (1..number).inject(1,:*)
end

def x(i, remain, has3, has5, has7)
#	p [i, remain, has3, has5, has7]
	if remain == 1 then
		result = 0
		result += 1 if (i * 10 + 3) <= $n && has5 && has7
		result += 1 if (i * 10 + 5) <= $n && has3 && has7
		result += 1 if (i * 10 + 7) <= $n && has3 && has5
#		p ["result", result]
		result
	else
		x(i * 10 + 3, remain -1, true, has5, has7) +
		x(i * 10 + 5, remain -1, has3, true, has7) +
		x(i * 10 + 7, remain -1, has3, has5, true)
	end
end

(3..n_size).each{ |max|
	count += x(0, max, false, false, false)
}

puts count
//  [ruby]
$n = gets.to_i
$ans = 0

def dfs(current, is_3, is_5, is_7)
  return if current > $n
  $ans += 1 if is_3 && is_5 && is_7
  dfs(current * 10 + 3, true, is_5, is_7)
  dfs(current * 10 + 5, is_3, true, is_7)
  dfs(current * 10 + 7, is_3, is_5, true)
end

dfs(0, false, false, false)
puts $ans
//  [ruby]
input = gets.to_i

if input.to_s.length <=2
  puts 0
  exit
end

r = [].fill([0,3,5,7], 0, input.to_s.length).inject(&:product).map do |e|
  e.flatten.join.to_i
end.reject do |num|
  num.to_s.include?('0') || num > input
end.select do |num|
  s = num.to_s
  [3,5,7].map(&:to_s).all? do |i|
    s.include?(i)
  end
end.length

puts r
//  [ruby]
N = gets.to_i
result = 0

s = 27
while true do
  d4 = s.to_s(4).gsub(/1|2|3/, '1' => '3', '2' => '5', '3' => 7)
  if d4.to_i > N
    break
  end

  if /^[357]+$/.match(d4) && /3/.match(d4) && /5/.match(d4) && /7/.match(d4)
    result += 1
  end

  s += 1
end

puts result
//  [ruby]
n = gets.chomp.to_i

nums = [0, 3, 5, 7]

def to_n(s, nums)
  s.chars.map { |i| nums[i.to_i] }.join.to_i
end

count = 0
1.upto(4 ** n.to_s.length) do |i|
  s = i.to_s(4)
  break if to_n(s, nums) > n
  next if s.include?('0')
  next unless s.include?('1') && s.include?('2') && s.include?('3')
  count += 1
end
puts count
//  [rust]
use std::io::prelude::*;

fn input<T: std::str::FromStr>() -> T {
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

#[allow(dead_code)]
fn with_stdout_lock<F: FnOnce(std::io::BufWriter<std::io::StdoutLock>)>(f: F) {
    let out = std::io::stdout();
    let w = std::io::BufWriter::new(out.lock());
    f(w);
}

#[allow(unused_macros)]
macro_rules! debug {
    ($var:expr) => {
        match &$var { v => eprintln!(concat!(stringify!($var), "={:?}"), v) }
    };
    ($var:expr, $($vars:expr),*) => {
        match &$var { v => eprint!(concat!(stringify!($var), "={:?} "), v) }
        debug!($($vars),*);
    };
}

fn main() {
    let n: i64 = input();

    println!("{}", dfs(0, n, false, false, false));
}

fn dfs(x: i64, n: i64, has7: bool, has5: bool, has3: bool) -> i64 {
    if x > n {
        0
    } else {
        let mut ans = if has7 && has5 && has3 { 1 } else { 0 };
        ans += dfs(x * 10 + 7, n, true, has5, has3);
        ans += dfs(x * 10 + 5, n, has7, true, has3);
        ans += dfs(x * 10 + 3, n, has7, has5, true);
        ans
    }
}
//  [rust]
// 標準入力から一行を読み取り、指定の型に変換する
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

// 753数の数を再帰的に求める.
fn chk_753(n: u64, value: u64, bit753: u8, count: &mut u64) {
    if value > n { return; }
    if bit753 & 7 == 7 { *count += 1; }

    // add 7
    chk_753(n, value * 10 + 7, bit753 | 4, count);
    // add 5
    chk_753(n, value * 10 + 5, bit753 | 2, count);
    // add 3
    chk_753(n, value * 10 + 3, bit753 | 1, count);
}

fn main() {
    let n: u64 = read();
    let mut count: u64 = 0;
    chk_753(n, 0, 0, &mut count);

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

fn main() {
  input! {
    n: usize,
  }

  let mut count = 0;
  let mut i = 0;
  let mut v = 357;
  while v <= n {
    let mut temp = v;
    let mut f3 = false;
    let mut f5 = false;
    let mut f7 = false;
    while 0 < temp {
      let vv = temp % 10;
      if vv == 7 {
        f7 = true;
      } else if vv == 5 {
        f5 = true;
      } else if vv == 3 {
        f3 = true;
      } else {
        f3 = false;
        break
      }
      temp /= 10;
    }
    if f3 && f5 && f7 {
      count += 1;
    }
    
    if i % 3 == 0 {
      v += 6;
    } else {
      v += 2;
    }
    i += 1;
  }
  println!("{}", count);
}
//  [swift]
let n = cin.int
var count = 0

func toInt(_ A: [Int]) -> Int {
    var sum = 0
    A.enumerated().forEach { a in
        sum += a.element * (10 ^^ a.offset)
    }
    return sum
}

func dfs(_ A: inout [Int]) {
    if toInt(A) > n {
        return
    } else {
        /// 3,5,7 が1回以上含まれている
        if A.contains(3) && A.contains(5) && A.contains(7) {
            count += 1
        }
    }

    for v in [3,5,7] {
        A.append(v)
        dfs(&A)
        A.removeLast()
    }
}

var A = [Int]()
dfs(&A)

print(count)

// MARK: #### 以下、ライブラリ ####

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var int: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var str: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { str.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { str.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in int } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

precedencegroup PowerPrecedence { higherThan: MultiplicationPrecedence }
infix operator ^^ : PowerPrecedence
func ^^ (radix: Int, power: Int) -> Int {
    return Int(pow(Double(radix), Double(power)))
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}
//  [typescript]
import * as fs from "fs";

let N = Number(fs.readFileSync("/dev/stdin", "utf8").trim());
let shichiGoSan = ["7", "5", "3"];

function count(s: string): number {
    if (Number(s) > N)
        return 0;
    let allPresent: boolean = true;
    let answer = 0;
    for(let sh of shichiGoSan) {
        allPresent = allPresent && s.indexOf(sh) != -1;
        answer += count(s+sh);
    }
    answer += allPresent?1: 0;
    return answer;
}

console.log(count("0"));
//  [typescript]
function main(input) {
  const n = Number(input.trim());
  let result = 0;
  const rf = (str) => {
    if(n < Number(str)) return;
    if(str.indexOf("7") !== -1 && str.indexOf("5") !== -1 && str.indexOf("3") !== -1) {
      result++;
    }
    ["7", "5", "3"].forEach(a => {
      rf(str + a);
    });
  };
  rf("");
  console.log(result);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [typescript]
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const n = Number(stdin.split('\n')[0])

let count = 0

const ans = () => {
  dfs(0)

  console.log(count)
}

const dfs = val => {
  const strVal = String(val)

  if (val > n) {
    return
  }

  if (strVal.indexOf('3') >= 0 && strVal.indexOf('5') >= 0 && strVal.indexOf('7') >= 0) {
    count++
  }

  dfs(10 * val + 3)
  dfs(10 * val + 5)
  dfs(10 * val + 7)
}

ans()
//  [typescript]
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const n = +input[0];

const toNum = (x:number) => +(x.toString(4).replace(/3/g,"7").replace(/2/g,"5").replace(/1/g,"3"));
let crr = 0;
let result = 0;
loop:
while(true){
  const crr4 = crr.toString(4);
  const check = [false, false, false, false]
  for(let i=0; i<crr4.length; i++){
    if(crr4[i] === "0") {
      crr += 1;
      continue loop;
    }
    check[+crr4[i]] = true;
  }
  if(toNum(crr) > n) break;
  if (check[1] && check[2] && check[3]) result += 1;
  crr += 1;
}

console.log(result);
//  [python]
S = input()
w = int(input())

m = ""
for i in range(0, len(S), w):
    m += S[i]
print(m)
//  [python]
n=input()
s=int(input())
t=len(n)//s
c=""
for i in range((t+1 if len(n)%s!=0else t)):
    c+=n[i*s]
print(c)
//  [python]
S = input()
w = int(input())
print(S[::w])
//  [python]
s=list(input())
w=int(input())
print(''.join([x for i,x in enumerate(s) if i%w==0]))
//  [python]
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

S = input()
w = int(input())
print(S[0::w])
//  [python]
a = list(input())
b = int(input())
if len(a)%b == 0:
  for i in range(len(a)//b):
    print(a[i*(b)],end="")
else:
  for i in range(len(a)//b+1):
    print(a[i*(b)],end="")
//  [java]
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {
	    String[] inputs = Io.read();
	    String s = inputs[0];
	    int x = Integer.parseInt(inputs[1]);

	    StringBuilder builder = new StringBuilder();

	    for (int i = 0; i < s.length(); i++) {
	        if (i % x == 0) {
	            builder.append(s.charAt(i));
            }
        }
        String ans = builder.toString();

	    Io.write(ans);
    }
}

class Io {

    public static String[] read() throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        List<String> inputs = new ArrayList<>();
        String line;
        while ((line = br.readLine()) != null) {
            if (line.equals(""))
                break;

            inputs.add(line);
        }
        br.close();
        return inputs.toArray(new String[0]);
    }

    public static void write(String answer)
    {
        System.out.println(answer);
    }
}
//  [java]
import java.util.*;
import java.io.*;
import java.math.*;
 
 
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
 
public class Main{
    static final long mod=1000000007;
    
    public  static void main(String[] args)   throws Exception, IOException{
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);
        // int n=sc.nextInt();
        // char c[][] = new char[h][w];
        // char c[]=sc.nextString().toCharArray();
        // for(int i=0; i<n; i++) {a[i]=sc.nextInt();}
        char c[]=sc.nextString().toCharArray();
        int w=sc.nextInt();
        String s="";
        for (int i=0; i<c.length;i+=w ) {
            s=s+c[i];
        }
        out.println(s);
        out.flush();
    }
    

    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }
     
    static boolean validpos(int x,int y,int r, int c){
        return x<r && 0<=x && y<c && 0<=y;
    }
    
    static boolean bit(long x,int k){
        // weather k-th bit (from right) be one or zero
        return  ( 0 < ( (x>>k) & 1 )  )  ? true:false;
    }    

    class P implements Comparable<P>{
        long x;
        double d;
        P(long x, double d) {
            this.x=x;
            this.d=d;
        } 
          
        public int compareTo(P p){
            return (d - p.d)>0?1:-1;//des
        } 
    }
}
class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}
//  [java]
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int w = sc.nextInt();
        for (int i = 0; i < s.length(); i += w) {
            System.out.print(s.charAt(i));
        }
    }
}
//  [java]
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		String s = scn.next();
		int w = scn.nextInt();
      	String[] list = s.split("");
      	String ans = "";
      	for(int i=0; i<s.length(); i+=w){
          ans = ans + list[i];
        }
      	System.out.println(ans);
	}
}
//  [java]
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int w = sc.nextInt();
		String ans = "";
		
		for(int i = 0; i < s.length; i++){
			if(i%w==0) ans += String.valueOf(s[i]);
		}
		System.out.println(ans);
	}
}
//  [cpp]
#include<cstdio>
#include<vector>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
char s[1000005];
int w;
int main()
{
	scanf("%s",s);
	scanf("%d",&w);
	int len=strlen(s);
	for(int i=0;i<len;i+=w)
		printf("%c",s[i]);
}
//  [cpp]
#include<cstdio>
#include<cstring>
using namespace std;
#define MAXN 10000000
char s[MAXN];
int main()
{
	int d;
	scanf("%s",s);
	int len=strlen(s);
	scanf("%d",&d);
	for(int i=0;i<len;i+=d)
		printf("%c",s[i]);
}
//  [cpp]
#include<cstdio>
#include<cstring>
#define maxl 5000005
using namespace std;
int len,x;
char ch[maxl];
int main(){
	scanf("%s",ch+1);
	scanf("%d",&x);
	len=strlen(ch+1);
	for (int i=1;i<=len;i+=x) printf("%c",ch[i]);
	return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

vll adj[MAXN]; ll visit[MAXN] = {};
int dx8[] = {0, 1, 1, 1, 0, -1, -1, -1}, dy8[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, x, m, y, k;
string s;

// <------------- Implement Functions Here ----------> //



// <------------- Start of main() -------------------> //

void MAIN() {
	cin >> s >> n;
	m = s.length();
	for(ll i=0;i<m;i+=n) cout<<s[i];
}

int main() {
	fastio; randomINT;
	//cin>>T;
	while (T--) {
		MAIN();
	}
	return 0;
}
//  [cpp]
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <cstdio>
#include <utility>

using namespace std;

int main()
{
    string s;
    int w;
    cin>>s>>w;
    for (int i=0; i<s.size(); i+=w) cout<<s[i];
    cout<<endl;
    return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main()
{
  string s;
  int w;

  cin >> s >> w;

  for(int i=0;i < s.size();i+=w)
    {
      cout << s[i];
    }
  cout << endl;
  return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

char s[1010];
int main(){
	int w;
	scanf("%s%d",s,&w);
	int n=strlen(s);
	for(int i=0;i<n;i+=w)putchar(s[i]);
}
//  [c]
#include <stdio.h>
#include <string.h>
int main() {
	char s[1001];
	int w;
	scanf("%s%d", s, &w);
	int len = strlen(s);
	for (int i = 0; i < len; i++) {
		if (i % w == 0) {
			printf("%c", s[i]);
		}
	}
	printf("\n");
	return 0;
}
//  [c]
#include <stdio.h>

int main(void) {
	char S[1024 * 2] = "";
	int w;
	int i;
	if (scanf("%1023s", S) != 1) return 1;
	if (scanf("%d", &w) != 1) return 1;
	for (i = 0; S[i] != '\0'; i += w) putchar((unsigned char)S[i]);
	putchar('\n');
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(void) {

  char s[1001];
  int w;
  scanf("%s %d", s, &w);
  for (int i = 0; i < strlen(s); i++) {
    if (i%w == 0) {
      printf("%c", s[i]);
    }
  }
  printf("\n");

  return 0;
}
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const S = arg[0].split("");
    const W = parseInt(arg[1]);
    
    let answer = [];
    
    for(let i in S) {
        if(i % W === 0) {
            answer.push(S[i]);
        }
    }
    
    console.log(answer.join(""));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [javascript]
var inf = Number.MAX_SAFE_INTEGER;
function Main(input) {
	input = input.split("\n");
	var n = input[1]-0;
	var arr = input[0].split("");
	var ans = "";
	for(var i=0;i<arr.length;i++){
		if(i%n==0) ans += arr[i];
	}
	console.log(ans)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function myout(text){console.log(text);}//standard output
function Main(input) {
	//input = parseInt(input);
	//input = input.split(" ");
	input = input.split("\n");
	//input = input.split(" ").map((a)=>Number(a));
	//input = input.split("\n").map((a)=>Number(a));
  var S = input[0];
  var w = parseInt(input[1]);
  if(w == 1){
     myout(S);
    return;
     }
  S = S.split("");
  var list = [];
  while(S.length != 0){
    	var tmp = "";
        for(var i = 0; i < w; i++){
          if(S.length != 0){
          	tmp += S.shift();
          }
        }
    list.push(tmp);
  }
  var output = "";
  for(var i = 0; i < list.length; i++){
    output += list[i].slice(0,1);
  }
  myout(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [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 = input[0];
	var w = toInt(input[1]);
	var n = s.length;
	var ans = '';
	for(var i = 0; i < n; i+=w){
		ans += s[i];
	}

	console.log(ans);
}
//  [javascript]
"use strict";

process.stdin.resume();
process.stdin.setEncoding('utf8');

var g_input = '';
process.stdin.on('data', function(chunk) {
    g_input += chunk;
});

process.stdin.on('end', function() {
    Main(g_input.split(/\r?\n/));
});

function Main(input) {

    const s = input[0].split('');
    const w = parseInt(input[1], 10);

    let ans = '';
    for (let i = 0; i < s.length; i += w) {
        ans = ans + s[i];
    }

    console.log(ans);

    return 0;
}
//  [javascript]
function Main(input) {
	input = input.split('\n');

	var reg = new RegExp(`[a-z]{0,${input[1]}}`, 'g');
	console.log(input[0].match(reg).map(str => str[0]).join(''));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	s := getNextString(scanner)
	n := len(s)
	w := getNextInt(scanner)
	for i := 0; i < n; i += w {
		fmt.Fprintf(writer, "%c", s[i])
	}
	fmt.Fprintln(writer, "")
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextString() string {
	if !sc.Scan() {
		panic("failed scan string")
	}
	return sc.Text()
}

func nextInt() int {
	if !sc.Scan() {
		panic("failed scan int")
	}
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	s := nextString()
	w := nextInt()
	b := []byte(s)
	var buf []byte
	for i := 0; i < len(b); i += w {
		buf = append(buf, b[i])
	}
	fmt.Println(string(buf))
}
//  [go]
package main

import "fmt"

var s string
var w int

func main() {
	fmt.Scan(&s, &w)
	ans := []string{}
	for i := 0; i < len([]rune(s)); i += w {
		ans = append(ans, string([]rune(s)[i]))
	}
	for _, a := range ans {
		fmt.Print(a)
	}
	fmt.Println()
}
//  [go]
package main

import "fmt"

func main() {
	// Code for B - Acrostic
	var S string
	fmt.Scanf("%s", &S)
	var w int
	fmt.Scanf("%d", &w)

	for i := 0; i < len(S); i = i + w {
		fmt.Printf("%c", S[i])
	}

	fmt.Println()
}
//  [ruby]
s = gets.chomp
w = gets.to_i
t = ""
i = 0
while i < s.length do
  t += s[i]
  i += w
end
puts t
//  [ruby]
s = gets.chomp.chars
w = gets.to_i
res = ""
0.step(s.size - 1, w) do |i|
  res += s[i]
end
puts res
//  [ruby]
s = gets.chomp.chars
w = gets.to_i

puts s.select.with_index { |_, idx| idx % w == 0 }.inject(:+)
//  [ruby]
s = gets.chomp.split('')
w = gets.to_i
a = s.each_slice(w).map{_1[0]}
puts a.join
//  [ruby]
require 'pp'
IS_DEBUG = true
# IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end

require 'pp'

INT_MAX = 999999999999999999999999

S=gets.chomp.split('')
w,d=gets.chomp.split(' ').map{|n| n.to_i}

puts S.each_with_index.select{|s,i| i%w==0}.map{|s,i| s}.join("")
//  [ruby]
s=gets;(0..1e4).step(gets.to_i){|i|$><<s[i]}
//  [rust]
#![allow(non_snake_case,unused_imports,dead_code)]
use std::io::Read;
use std::cmp::max;
use std::cmp::min;
use std::str::FromStr;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::BinaryHeap;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut buf_it = buf.split_whitespace();
    let S = buf_it.next().unwrap();
    let w = buf_it.next().unwrap().parse::<usize>().unwrap();

    let n = S.len();
    println!("{}",(0..n).filter(|&i| i%w==0).fold(String::new(),|x,y| x + &S[y..y+1]));
}
//  [rust]
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

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")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

#[allow(dead_code)]
const MAX:usize = 100006;
#[allow(dead_code)]
const INF_U32:u32 = 1 << 31;
#[allow(dead_code)]
const INF_I32:i32 = 1 << 30;
#[allow(dead_code)]
const INF_U64:u64 = 1 << 63;
#[allow(dead_code)]
const INF_I64:i64 = 1 << 62;


fn main() {
    let s:Vec<char> = read::<String>().chars().collect();
    let w:u32 = read();

    for (i, &ch) in s.iter().enumerate() {
        if i as u32 % w == 0 {print!("{}",ch)}
    }
    println!("");

}
//  [rust]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use proconio::*;
use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let s: String = read!();
    let n: usize = read!();
    let s = s.chars().collect_vec();

    let len = s.len();

    let mut buf = String::new();
    for i in 0..=len {
        if len  <= i * n {
            break;
        }

        buf.push(s[i * n]);
    }

    println!("{}", buf);
}
//  [rust]
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};
fn main() {
    input! {//
        s:Chars,
        w:usize,
    }
    for i in 0..s.len() {
        if i % w == 0 {
            print!("{}", s[i]);
        }
    }
    println!("");
}
//  [swift]
let S=readLine()!.characters.map{"\($0)"},w=Int(readLine()!)!
print((0..<S.count).filter{$0%w==0}.reduce(""){$0+S[$1]})
//  [typescript]
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* eslint-env es6, mocha, node */
/* eslint-extends: eslint:recommended */
'use strict';



// Import modules
import fs = require("fs");


// Read stdin
const data = fs.readFileSync("/dev/stdin", "utf-8").split("\n");
const words = data[0];
const count = Number(data[1]);


// Main
const result = [];
for (let i = 0; i < words.length; i = i + count) {
    result.push(words.charAt(i));
}


// Output
console.log(result.join(""));



/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * c-hanging-comment-ender-p: nil
 * End:
 */
//  [typescript]
"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let S = xs[0].split('');
   let w = parseInt(xs[1]);
   let str =[];
   for(let i=0; i<S.length; i++){
      if(i%w==0){
      str.push(S[i]);
      }
   }
   let ans ='';
   str.forEach(element => ans+=(element));
   console.log(ans);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));
//  [python]
N = int(input())
import numpy as np
a = np.empty((26,15))
for i in range(26):
  for j in range(15):
    a[i][j] = 4 * i + 7 * j

if N in a:
  print('Yes')
else:
  print('No')
//  [python]
import numpy as np
import math

N = int(input())

# N = 4 a + 7 b

DP = []
DP.append(True)

for i in range(1, N+1):
    if (i - 4 >= 0 and DP[i - 4]) or \
       (i - 7 >= 0 and DP[i - 7]):
        DP.append(True)
    else:
        DP.append(False)

if DP[N]:
    print('Yes')
else:
    print('No')
//  [python]
import numpy as np
a = int(input())
if(a > 7):
	c = np.zeros(a)
	for i in range(7):
		if(i == 3 or i == 6):
			c[i] = 1
	#print(c)
	for i in range(7, c.shape[0]):
		if(c[i-4] == 1 or c[i-7] == 1):
			c[i] = 1
	if(c[-1] == 1):
		print("Yes")
	else:
		print("No")
else:
	if(a == 4 or a == 7):
		print("Yes")
	else:
		print("No")
//  [java]
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();

		int sum = 0;

		boolean flag = false;

		for(int i=0;i<N+1;i++) {

			for(int j=0;j<N-i+1;j++) {

				sum = 4*i + 7*j;

				if(sum == N) {

					flag = true;

				}

			}

		}

		if(flag == true) {

			System.out.println("Yes");
		}else {

			System.out.println("No");
		}

	}

}
//  [java]
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();

        if(N%7 == 0 || N%4 == 0){
            System.out.println("Yes");
            System.exit(0);
        }
        while(N>=4){
            N -= 4;
            if(N%7 == 0){
                System.out.println("Yes");
                System.exit(0);
            }
        }
        System.out.println("No");
    }
}
//  [java]
public class Main {
	public static void main(String[] args) {
		int n = new java.util.Scanner(System.in).nextInt();
		
		for (int i = 0; i <= n / 4; i++) {
			// 4ドルのケーキの金額 (4ドル x i個)
			int a = i * 4;
			for (int j = 0; j <= n / 7; j++) {
				// 7ドルのケーキの金額(7ドル x j個)
				int b = j * 7;
				if (a + b == n) {
					System.out.println("Yes");
					return;
				}
			}
		}
		System.out.println("No");
	}
}
//  [cpp]
#include<bits/stdc++.h>
#include<sys/time.h>
using namespace std;

string ans="00100110010110111111110";
const int timelim=2;

int gettime(){
  timeval tv;
  gettimeofday(&tv, NULL);
  int x = tv.tv_sec % timelim * 1000 + tv.tv_usec / 1000;
  return x;
}
 
int T=30;
 
int main(){
  //puts("Yes"); while (gettime()>10); return 0;
  int x=gettime()/T;
  if (x>=23){
    x=0;
  }
  puts(ans[x]=='1'? "Yes": "No");
  int aim=((x+1)*T-450+timelim*1000)%(timelim*1000);
  while (1){
    int t=gettime();
    if (t<=aim&&t>=aim-1) return 0;
  }
}
//  [cpp]
#include<bits/stdc++.h>
#include<sys/time.h>
using namespace std;

string ans="00100110010110111111110";
const int timelim=2;

int gettime(){
  timeval tv;
  gettimeofday(&tv, NULL);
  int x = tv.tv_sec % timelim * 1000 + tv.tv_usec / 1000;
  return x;
}
 
int T=40;
 
int main(){
  //puts("Yes"); while (gettime()>10); return 0;
  int x=gettime()/T;
  if (x>=23){
    x=0;
  }
  puts(ans[x]=='1'? "Yes": "No");
  int aim=((x+1)*T-440+timelim*1000)%(timelim*1000);
  while (1){
    int t=gettime();
    if (t<=aim&&t>=aim-1) return 0;
  }
}
//  [cpp]
    #include<bits/stdc++.h>
    #include<sys/time.h>
    using namespace std;
     
    string ans="00100110010110111111110";
    const int timelim=2;
     
    int gettime(){
      timeval tv;
      gettimeofday(&tv, NULL);
      int x = tv.tv_sec % timelim * 1000 + tv.tv_usec / 1000;
      return x;
    }
     
    int T=40;
     
    int main(){
      //puts("Yes"); while (gettime()>10); return 0;
      int x=gettime()/T;
      if (x>=23){
        x=0;
      }
      puts(ans[x]=='1'? "Yes": "No");
      int aim=((x+1)*T-440+timelim*1000)%(timelim*1000);
      while (1){
        int t=gettime();
        if (t<=aim&&t>=aim-1) return 0;
      }
    }
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

typedef long long ll;

int max(int a, int b){
  if(a > b) return a;
  else return b;
}
int min(int a, int b){
  if(a < b) return a;
  else return b;
}

int sort(const void *a ,const void *b){
  return *(int*)a - *(int*)b;
}

int main(){

  int n;
  scanf("%d",&n);
  for(int i = 0; i < 26; ++i){
    for(int j = 0; j < 16; ++j){
      if( i*4 + 7*j == n ){
        printf("Yes");
        return 0;
      }
    }
  }

  printf("No");

  return 0;
}
//  [c]
#include<stdio.h>

int main()
{
  int N;
  int n,m;
  int i,j;
  int t=0;
  int s=1;
  scanf("%d",&N);
  n=N/4;
  m=N/7;
  for(i=0;i<=n;i++){
    for(j=0;j<=m;j++){
      if(4*i+7*j==N){
        t=1;
        s=0;
        break;
      }
    }
    if(s==0) break;
  }
  if(t==1){
    printf("Yes");
  } else if(t==0){
    printf("No");
  }
  return 0;
}
//  [c]
#include <stdio.h>
int main(void) {
  int N,i,j,count = 0;
  scanf("%d",&N);
  for(i = 0; i <= N / 4; i++) {
    for(j = 0; j <= N / 7; j++) {
      if(4 * i + 7 * j == N) {
        count++;
      }
    }
  }
  if(count != 0) printf("Yes\n");
  else printf("No\n");
  return 0;
}
//  [javascript]
'use strict';

function Main(input) {
  let N = Number(input);

  const func = () => {
    if(N < 4) {
      console.log('No');
    } else if (N % 4 === 0) {
      console.log('Yes');
    } else if (N % 7 === 0) {
      console.log('Yes');
    } else {
      N -= 4;
      func();
    }
  };

  func();



};

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [javascript]
function Main(s){
  var n = +s;
  var ans = "No";
  for(var i = 0; i < n; i++){
    if(i * 4 > n)break;
    if((n - i * 4) % 7 === 0)ans = "Yes";
  }
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin","utf8"));
//  [javascript]
function main(arg) {
    arg = arg.split("\n")
    arg = parseInt(arg[0], 10)

    var flag = false
    for (var i = 0; i < 100; i++){
        var num = 4 * i
        if (num > arg) {
            break;
        }
        var sum = (arg - num)
        if ((sum % 7) === 0 ) {
            flag = true
            break
        }
    }
    if (flag) {
        console.log('Yes')
    } else {
        console.log('No')
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

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

func main()  {
	sc := bufio.NewScanner(os.Stdin)
	
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())

	flag := "No"
	for x4 := 0; x4 <= 100; x4++ {
		for x7 := 0; x7 <= 100; x7++ {
			if x4*4 + x7*7 == n {
				flag = "Yes"
			}
		}
	}
	fmt.Println(flag)
}
//  [go]
package main

import (
	"fmt"
)

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

	for i := 0; i <= n; i += 7 {
		if (n-i)%4 == 0 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func iScan() int {
	n, _ := strconv.Atoi(Scan())
	return n
}

func fScan() float64 {
	n, _ := strconv.ParseFloat(Scan(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func SScan(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scan()
	}
	return a
}
func iSScan(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = iScan()
	}
	return a
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func sum(a []int) int {
	x := 0
	for _, v := range a {
		x += v
	}
	return x
}

var mod int = 1000000007

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	n := iScan()
	ans := "No"
	for i := 0; 7*i <= n; i++ {
		if (n-7*i)%4 == 0 {
			ans = "Yes"
		}
	}
	fmt.Println(ans)
}
//  [ruby]
require 'pp'
require 'prime'

n = gets.chomp!.to_i

0.upto(25) do |i|
    0.upto(100 / 7) do |j|
        if i * 4 + j * 7 == n
            puts "Yes"
            exit 0
        end
    end
end

puts "No"
//  [ruby]
CP = 4
DP = 7

N = gets.strip.to_i

def dfs(c, d, p)
  return c + d if p == 0
  return 0 if p < 0 

  res = 0
  res += dfs(c + 1, d, p - CP)
  # res += dfs(c, d + 1, p - DP) if res == 0
  res += dfs(c, d + 1, p - DP)
  return res
end

res = dfs(0, 0, N)
puts res > 0 ? 'Yes' : 'No'
//  [ruby]
n=gets.to_i
(0..n).each do |i|
  (0..n).each do |j|
    next if i*4+j*7>n
    if i*4+j*7==n
      puts 'Yes'
      exit
    end
  end
end
puts 'No'
//  [rust]
use proconio::input;
fn main() {
    input! {
        n:usize,
    }
    for a in 0..100 {
        for b in 0..100 {
            if n == 4 * a + 7 * b {
                println!("Yes");
                return;
            }
        }
    }
    println!("No");
}
//  [rust]
use proconio::{input, fastout};
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
  }

#[fastout]
fn main() {
    input!{
        n: usize,
    }

    for x in 0..n/4+1 {
        for y in 0..n/7+1 {
            if 4*x+7*y==n {
                println!("Yes");
                return;
            }
        }
    }

    println!("No");

}
//  [rust]
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    n: usize,
    }
    for i in 0..n {
        for j in 0..n {
            if i * 4 + j * 7 == n {
                print!("Yes");
                return;
            }
        }
    }
    print!("No");
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const N = Number(input[0][0]);

  for (let i = 0; i <= N; i += 4) {
    if ((N - i) % 7 === 0) {
      return "Yes";
    }
  }

  return "No";
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc105 {

    class ProgramB {
        args: string[];

        // 11
        // Yes

        // 40
        // Yes

        // 3
        // No
        constructor(args: string[]) {
            this.args = args;
        }

        main(): void {
            // 4 or 7
            let n: number = parseInt(this.args[0], 10);
            while (n > 0) {

                if (n % 4 === 0) {
                    console.log('Yes');
                    return;
                }
                if (n % 7 === 0) {
                    console.log('Yes');
                    return;
                }
                n -= 4;
            }
            console.log('No');


        }
    }

    const args: string[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split('\n');
    new ProgramB(args).main();
}
//  [typescript]
const input=require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/);const tn=():number=>{const a=input[0];input.shift();return Number(a)};const tnn=(n:number):number[]=>{const a=[];for(let i=0;i<n;i++){a.push(tn())}return a};const ts=():string=>{const a=input[0];input.shift();return String(a)};const tss=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(ts())}return a};const tc=():string=>{let a=input[0].split('');const b=a[0];a.shift();if(a.length>0){input[0]=a.join('')}else{input.shift()}return String(b)};const tcc=(n:number):string[]=>{const a=[];for(let i=0;i<n;i++){a.push(tc())}return a};const to=(...arg)=>{console.log(...arg)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const floor=(a)=>{return Math.floor(a)};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};const 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 near=(n:number,arr:number[]):number=>{let ne=arr[0],ni=0;for(let i=1;i<arr.length;i++){if(Math.abs(n-ne)>Math.abs(n-arr[i])){ne=arr[i];ni=i}}return ni};const gojo=(a:number,b:number):number=>{if(a%b===0)return b;return gojo(b,a%b)};
const main=()=>{
  let n=tn(),ans='No'
  for(let i=0;i*4<=n;i++){
    for(let j=0;i*4+j*7<=n;j++){
      if(4*i+7*j===n)ans='Yes'
    }
  }
  to(ans)
}
main()
//  [python]

import itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)


def main():
    N,R = map(int,input().split())
    if N >= 10:
        print(R)
    else:
        print(R+(10-N)*100)



if __name__ == "__main__":
  main()
//  [python]
import numpy as np
N, R = map(int, input().split(" "))

if N >= 10:
    print(R)
else:
    print(R + 100 * (10 - N))
//  [python]
import sys
import numpy as np

#n=int(sys.stdin.readline())
n,r=map(int,sys.stdin.readline().split())
#a=np.array([sys.stdin.readline().split() for i in range(n)],np.int64)

if n>=10:
    print(r)
else:
    print(r+100*(10-n))
//  [java]
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int R = sc.nextInt();
        int ans;
        if (N < 10) {
            ans = R+100*(10-N);
        } else {
            ans = R;
        }
        System.out.println(ans);
    }
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;

int main() {
	vector<vector<vector<long long>>> U(10000,vector<vector<long long>>(100, vector<long long>(12,1000)));

	int N, M;
	cin >> N >> M;
	cout << M + (max(0, 10 - N) * 100);
}