jiahuimbzuai/CoQuIR huggingface dataset:
//  [rust]
use proconio::{fastout, input};

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

    let f = n/100;
    let s = n%100;

    let mut fy = false;
    let mut sy = false;

    if 1 <= s && s <= 12{
        fy = true;
    }

    if 1 <= f && f <= 12{
        sy = true;
    }
    
    if fy & sy{
        println!("AMBIGUOUS");
    }else if fy{
        println!("YYMM");
    }else if sy{
        println!("MMYY");
    }else{
        println!("NA");
    }

}
//  [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 min (a: &i64, b: &i64)-> i64{
    if *a <= 0i64 {*b}
    else if *b <= 0i64  {*a}
    else if *a < *b {*a}
    else {*b}
}

fn max (a: &i64, b:&i64) -> i64{
    if *a < *b {*b} else {*a}
}

fn abs (a: &i64, b: &i64) -> i64{
    if *a - *b <= 0 {*b - *a} else {*a - *b}
}

fn main(){
    input!{
        y: i32
    }
    let s = match (y / 100, y % 100){
        (1...12, 1...12) => "AMBIGUOUS",
        (1...12, _) => "MMYY",
        (_, 1...12) => "YYMM",
        _ => "NA"
    };
    println!("{}", s);
}
//  [rust]
use proconio::*;

fn is_month(n: u32) -> bool {
    return n >= 1 && n <= 12;
}

fn main() {
    input! {
        s: u32
    };
    let bef = s / 100;
    let aft = s % 100;
    if is_month(bef) && is_month(aft) {
        println!("AMBIGUOUS");
    } else if is_month(bef) {
        println!("MMYY");
    } else if is_month(aft) {
        println!("YYMM");
    } else {
        println!("NA");
    }
}
//  [swift]
import Foundation
let S = readLine()!

let first = Int(S.substring(with: NSRange(location: 0, length: 2)))
let second = Int(S.substring(with: NSRange(location: 2, length: 2)))

if let f = first, let s = second, 1...12 ~= f || 1...12 ~= s  {
  if f > 12 || f < 1 {
    print("YYMM")
  } else if s > 12 || s < 1 {
    print("MMYY")
  } else {
    print("AMBIGUOUS")
  }
} else {
  print("NA")
}
//  [swift]
import Foundation

let input_line = readLine()!
let start1 = input_line.startIndex.advancedBy(0)
let end1 = start1.advancedBy(2)
let start2 = input_line.startIndex.advancedBy(2)
let end2 = start2.advancedBy(2)

let first = Int(input_line.substringWithRange(Range(start: start1, end: end1)))!
let secound = Int(input_line.substringWithRange(Range(start: start2, end: end2)))!

if (0 < first && first <= 12) {  
	if(0 < secound && secound <= 12) {
    	print("AMBIGUOUS")
    } else {
    	print("MMYY") 
    }
} else {
	if(0 < secound && secound <= 12) {
    	print("YYMM")
    } else {
    	print("NA") 
    }
}
//  [typescript]
import * as fs from 'fs';

namespace AtCoder.abc126 {

    class ProgramB {
        // 1905
        // YYMM
        //
        // 0112
        // AMBIGUOUS
        //
        // 1700
        // NA
        main(inp: string) {
            const s: number[] = inp.split('').map(Number);
            const s12: number = parseInt(s.slice(0, 2).join(''), 10);
            const s34: number = parseInt(s.slice(2, 4).join(''), 10);

            let yymm: boolean = true;
            let mmyy: boolean = true;

            if (s34 === 0) yymm = false;
            if (s34 >= 13) yymm = false;

            if (s12 === 0) mmyy = false;
            if (s12 >= 13) mmyy = false;

            if (yymm && mmyy) console.log('AMBIGUOUS');
            if (yymm && !mmyy) console.log('YYMM');
            if (!yymm && mmyy) console.log('MMYY');
            if (!yymm && !mmyy) console.log('NA');
        }
    }

    const func = new ProgramB();
    func.main(fs.readFileSync('/dev/stdin', 'utf8').trim());

}
//  [typescript]
const input = require('fs').readFileSync('/dev/stdin', 'utf8')

const N: string = input.split('\n')[0]

const first = Number(N[0] + N[1])
const last = Number(N[2] + N[3])

if (first > 12 || first === 0) {
  if (last > 12 || last === 0) {
    console.log('NA')
  } else {
    console.log('YYMM')
  }
} else if (last > 12 || last === 0) {
  if (first === 0) {
    console.log('NA')
  } else {
    console.log('MMYY')
  }
} else if (first === 0 && last === 0) {
  console.log('NA')
} else {
  console.log('AMBIGUOUS')
}
//  [typescript]
import { readFileSync } from 'fs'

const check = (a: number, b: number) => {
  const aIsMonth = 1 <= a && a <= 12
  const bIsMonth = 1 <= b && b <= 12

  if (aIsMonth && bIsMonth) {
    return 'AMBIGUOUS'
  }
  else if (aIsMonth) {
    return 'MMYY'
  }
  else if (bIsMonth) {
    return 'YYMM'
  }
  else {
    return 'NA'
  }
}

function main(input: string) {
  const a = +input.slice(0, 2)
  const b = +input.slice(2)

  console.log(check(a, b))
}

main(readFileSync('/dev/stdin', 'utf8').trim())
//  [python]
def solve(s, k):
    mapping = {(chr(ord("a") + i)): (26-i)%26 for i in range(26)}
    t = list(s)
    n = len(s)
    for i in range(n):
        if k >= mapping[s[i]]:
            t[i] = "a"
            k -= mapping[s[i]]
    if k > 0:
        k %= 26
        j = ord(t[i]) + k
        if j > ord("z"):
            j -= 26
        t[n-1] = chr(j)
    return "".join(t)

s = input()
k = int(input())
print(solve(s, k))
//  [python]
def main():
    import sys
    input = sys.stdin.readline
    s = list(input().strip())
    K = int(input())
    for i, c in enumerate(s):
        if c == 'a':
            continue
        z = 123 - ord(c)
        if K >= z:
            s[i] = 'a'
            K -= z
        if K == 0:
            break
    
    s[-1] = chr(((ord(s[-1])-97+K))%26+97)

    print(''.join(s))

if __name__ == '__main__':
     main()
//  [python]
# code-festival-2016-qualaC - 次のアルファベット / Next Letter
def main():
    S = input().rstrip()
    K = int(input())
    abc = "abcdefghijklmnopqrstuvwxyz"
    # dist[c] := distance to "a" through "z"
    dist = {c: 26 - i for i, c in enumerate(abc)}
    dist["a"] = 0
    A = [dist[i] for i in S]
    ans = ""
    for i, s in zip(A[:-1], S[:-1]):
        if 0 < i <= K:  # change s to "a" if possible
            ans += "a"
            K -= i
        else:
            ans += s
    # use the remaining K on A[-1] and combine with ans
    ans += chr((ord(S[-1]) + K - ord("a")) % 26 + ord("a"))
    print(ans)


if __name__ == "__main__":
    main()
//  [python]
def main():
    import sys
    from collections import defaultdict

    def input(): return sys.stdin.readline().rstrip()

    s = input()
    n = len(s)
    k = int(input())
    for i in range(n):
        tmp = (ord('a')-ord(s[i]))%26
        if tmp > k:
            continue
        k -= tmp
        s = s[:i]+'a'+s[i+1:]
    s = s[:-1]+chr((ord(s[-1])+k%26-ord('a'))%26+ord('a'))
    print(s)

    
if __name__ == '__main__':
    main()
//  [python]
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


def main():
    S = input()
    K = int(input())

    S = [s for s in S]
    D = [ord('z') - ord(s) + 1 if s != 'a' else 0 for s in S]
    T = []
    for s, d in zip(S, D):
        if d <= K:
            T.append('a')
            K -= d
        else:
            T.append(s)

    c = ord(T[-1])
    for _ in range(K):
        if c == ord('z'):
            c = ord('a')
        else:
            c += 1
    T[-1] = chr(c)

    print(''.join(T))


if __name__ == '__main__':
    main()
//  [python]
s = input()
k = int(input())

for i in range(len(s)):
    if s[i] != "a":
        req = ord("z") - ord(s[i]) + 1

        if req <= k:
            k -= req
            s = s[:i] + "a" + s[i+1:]

if k > 0:
    s = s[:-1] + chr(ord(s[-1]) + k%26)

print(s)
//  [java]
import java.io.*;
import java.io.ObjectInputStream.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = (long)1e9+7;
	//final static long MOD = 998244353;

	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		slove(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void slove(String[] args) throws Exception{
		char[] s = nextString().toCharArray();
		int K = nextInt();

		for(int i=0;i<s.length;i++) {
			int dist = (26-(s[i]-'a'))%26;
			if(K-dist>=0) {
				K-=dist;
				s[i]='a';
			}
		}
		s[s.length-1]=(char)('a'+((s[s.length-1]-'a'+K)%26));

		pw.println(s);
	}


	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}
//  [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 k = sc.nextInt();

		for (int i = 0; i < s.length(); i++) {
			int c = (int)(s.charAt(i) - 'a');
			if (i == s.length() - 1) {
				c = (c + k) % 26;
			} else if (c != 0 && 26 - c <= k) {
				k -= 26 - c;
				c = 0;
			}
			System.out.printf("%c", (char)c + 'a');
		}
		System.out.println();
	}
}
//  [java]
import java.io.InputStreamReader;
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		try(Scanner scan = new Scanner(new InputStreamReader(System.in))){
			StringBuilder s = new StringBuilder(scan.nextLine());
			int K = scan.nextInt();
			
			int index = 0;
			
			while(K > 0 && index < s.length()){
				int diff = ('z' - s.charAt(index) + 1) % 26;
				if(K - diff >= 0){
					K -= diff;
					s.replace(index, index+1, "a");
				}
				index++;
			}
			
			char c = s.charAt(s.length()-1);
			for(;K>0; K--){
				c++;
				if(c > 'z'){
					c = 'a';
				}
			}

			s.replace(s.length()-1, s.length(), String.valueOf(c));
			
			System.out.println(s.toString());
		}
	}
}
//  [cpp]
#include <cstdio>

int main()
{
  char s[100001];
  int k;
  scanf("%s%d", s, &k);
  char *p;
  for (p = s; *p; ++p)
  {
    if (*p == 'a') continue;
    if ('a' + 26 - *p <= k)
    {
      k -= 'a' + 26 - *p;
      *p = 'a';
    }
  }
  --p;
  *p = (*p - 'a' + k) % 26 + 'a';
  puts(s);
  return 0;
}
//  [cpp]
#include<cstdio>
#include<cstring>
const int maxn=100005;
char str[maxn];int k;
int main(){
  scanf("%s%d",str+1,&k);
  int n=strlen(str+1);
  for(int i=1;i<=n;++i){
    if(str[i]!='a'&&'z'-str[i]+1<=k){
      k-=('z'-str[i]+1);
      str[i]='a';
    }
  }
  if(k==0)printf("%s\n",str+1);
  else{
    k%=26;
    str[n]=str[n]+k;
    if(str[n]>'z')str[n]-=26;
    printf("%s\n",str+1);
  }
  return 0;
}
//  [cpp]
#include <cstdio>
#include <cstring>

using namespace std;

char S[100010];
int K;
int main() {
  scanf("%s", S);
  scanf("%d", &K);
  int N=strlen(S);
  for(int i=0;i<N;++i) {
    int t= S[i] == 'a' ? 0 : 'z' - S[i]+1;
    if (t <= K) {
      K-=t;
      S[i] = 'a';
    }
  }
  if (K>0) {
    S[N-1]= 'a' + (S[N-1] - 'a' + K) % 26;
  }
  printf("%s\n",S);
  return 0;
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;

int main(){
  string s;
  std::cin >> s;
  int k;
  std::cin >> k;
  for (int i = 0; i < s.length(); i++) {
    if('z' + 1 - s[i] <= k and s[i] != 'a'){
      k -= 'z' + 1 - s[i]; 
      s[i] = 'a';
    }
  }
  for (int i = 0; i < k; i++) {
    if(s[s.length() - 1] == 'z'){
      s[s.length() - 1] = 'a';
    }else{
      s[s.length() - 1]++;
    }
  }
  std::cout << s << std::endl;
  return 0;
}
//  [cpp]
#include "bits/stdc++.h"

using namespace std;
using ll = long long;

const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };

#define INF 99999999
#define MOD (int)1e9 + 7
#define rep(i,n) for(int i = 0;i<n;i++)

int main() {

	int k;
	string s;

	cin >> s;
	cin >> k;

	rep(i, s.length()) {
		if (s[i] == 'a')continue;
		if (k >= 26- (s[i] - 'a')) {
			k -= 26 - (s[i] - 'a');
			s[i] = 'a';
		}
	}

	if (k > 0) {
		rep (i, k) {
			if (s[s.length() - 1] == 'z') s[s.length() - 1] = 'a';
			else s[s.length() - 1] += 1;
		}
	}

	cout << s << endl;
	
	return 0;
}
//  [cpp]
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cstring>
#include <string>
#include <stack>
#include <tuple>

using namespace std;
typedef long long ll;
ll MOD = 1e9 + 7;

int main()
{
    string s;
    int k;
    cin >> s >> k;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] != 'a' && 'z' - s[i] + 1 <= k)
        {
            k -= 'z' - s[i] + 1 ;
            s[i] = 'a';
        }
    }
    for (int i = 0; i < k; i++)
    {
        auto p = s.size() - 1;
        if (s[p] == 'z') s[p] = 'a';
        else s[p]++;
    }
    cout << s << endl;
    return 0;
}
//  [c]
#include <stdio.h>
#include <stdlib.h>

int main()
{
	char s[100001];
	long long K;
	scanf("%s", s);
	scanf("%lld", &K);
	
	int i;
	for (i = 0; s[i] != 0; i++) {
		if (s[i] == 'a') continue;
		else if (K >= 26 - s[i] + 'a') {
			K -= 26 - s[i] + 'a';
			s[i] = 'a';
		}
	}
	s[i-1] = (s[i-1] - 'a' + K % 26) % 26 + 'a';
	
	printf(s);
	fflush(stdout);
	return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>

int main(void) {

  char s[100001];
  scanf("%s", s);
  long k;
  scanf("%ld", &k);
  long length = strlen(s);
  for (long i = 0; i < length-1; i++) {
    if (k == 0) {
      break;
    }
    if (s[i] != 'a' && 'z'+1-s[i] <= k) {
      k -= 'z'+1-s[i];
      s[i] = 'a';
    }
  }
  k %= 26;
  int to_a = 'z'-s[length-1]+1;
  if (to_a <= k) {
    k -= to_a;
    s[length-1] = 'a';
  }
  s[length-1] += k;
  printf("%s\n", s);

  return 0;
}
//  [c]
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

int comp(const void *a, const void *b){return *(int*)a-*(int*)b;}
int compw(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return *(int*)b-*(int*)a;}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint_fast32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){
	char c=getchar();
	while(c==' '||c=='\n'||c=='\r'||c=='\t') c=getchar();
	uint32_t len=0;
	while(c!=' '&&c!='\n'&&c!='\r'&&c!='\t'){ *s++=c; len++; c=getchar(); }
	*s='\0';
	return len;
}

inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}

char s[100001];
int main(void){
	int n=nextstr(s);
	int k=nextpint();
	for(int i=0; i<n; i++){
		int n='{'-s[i];
		if(n!=26 && n<=k){
			k-=n;
			s[i]='a';
		}
	}
	s[n-1]=(s[n-1]-'a'+k)%26+'a';
	puts(s);
}
//  [c]
#include<stdio.h>
#include<string.h>

#define LEN 100000

int main(void){
    char str[LEN + 1];
    int dist[LEN];
    long i, K, lastletter;
    
    char dummy;
    
    scanf("%s", str);
    scanf("%c", &dummy);
    scanf("%ld", &K);
    
    for(i = 0; i < strlen(str); i++){
        if(str[i] == 'a') dist[i] = 0;
        else dist[i] = 1 + 'z' - str[i];
        
        if(dist[i] <= K){
            str[i] = 'a';
            K -= dist[i];
        }
    }
    
    i--;
    lastletter = str[i] - 'a';
    
    lastletter += K;
    lastletter %= 26;
    
    str[i] = lastletter + 'a';
    
    printf("%s", str);
    
    return 0;
}
//  [c]
#include <stdio.h>
#include<string.h>

int main(void) {
	char s[100005];
	int k;
	
	fgets(s,sizeof(s), stdin);
	scanf("%d", &k);
	int kariK = k;
	char tmp;
	int a;
	
	for(int i = 0; i < k; i++){
		a = s[i] - 'a';
		if(a + kariK >= 26 && a > 0){
			s[i] = 'a';
			kariK = a + kariK - 26;
			if(kariK == 0){
				break;
			}
		}
		
		if(i  >= strlen(s) - 2){
			s[i] += kariK % 26;
				if(s[i] - 'z' > 0){
					s[i] = s[i] -  'z';
				}
			break;
		}
	}
	
	printf("%s",s);
	
	return 0;
}
//  [c]
t;i;K;char s[100001];main(){gets(s);scanf("%d",&K);
	for(;i<strlen(s)&&K;++i){
		if(s[i]>'a'&&('z'+1-s[i])<=K){
			K-='z'+1-s[i];
			s[i]='a';
		}
	}
	if(K){
		t=s[strlen(s)-1];
		s[strlen(s)-1]='a'+(t-'a'+K)%26;
	}
	K=!puts(s);
}
//  [javascript]
function myout(text){console.log(text);}//standard output
function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	input = input.trim().split("\n");
	//input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  var s = input[0];
  var N = parseInt(input[1]);
  var sList = new Array(s.length);
  var conv = "abcdefghijklmnopqrstuvwxyz".split("");
  var convList = {};
  for(var i = 0; i < conv.length; i++){
    convList[conv[i]] = i;
  }
  //Nの許す限り、左側の文字からaにしていく。s[i] + Nの一部 = 26(conv26番目)
  //ただしs[i]が0ならスルー
  //Nが不足してs[i]を0にできないなら次の文字へ
  //Nが少なくなってどの文字もs[i]を0にできないなら右端の文字だけNだけ進める
  //右端についた時点でNが余り過ぎてたら右端の文字だけ「Nの残り % 26」だけ進める
  for(var i = 0; i < s.length; i++){
  	sList[i] = convList[s.slice(i,i+1)];
  }
  for(var i = 0; i < s.length; i++){
    if(sList[i] == 0 && i != s.length - 1){
       continue;
    }
    if(i == s.length - 1){
       sList[i] = (sList[i] + N) % 26;
      continue;
    }
    if(N == 0){
       break;
    }else if(N < (26 - sList[i])){
      continue;
    }else{
      var add = 26 - sList[i];
      sList[i] = (sList[i] + add) % 26;
      N -= add;
    }
    //myout(sList[i]);
  }
  var output = "";
  for(var i = 0; i < s.length; i++){
    output += conv[sList[i]];
  }
  myout(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
var lines = []; var result = "";
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
});

rl.on('close', function () {
    var s = lines[0].split("");
    var K = Number(lines[1]);
    var len = s.length;

    var s_code = Array(len).fill(0)
    for (var i = 0; i < len; i++) {
        s_code[i] = s[i].charCodeAt(0);
    }

    for (var i = 0; i < len; i++) {
        if (i === len - 1) {
            K = K % 26;
            s_code[i] + K > "z".charCodeAt(0) ? s_code[i] = 97 + s_code[i] + K - "z".charCodeAt(0) - 1 : s_code[i] += K;
        }
        else {
            if ("z".charCodeAt(0) - s_code[i] + 1 <= K && s_code[i] !== "a".charCodeAt(0)) { K -= "z".charCodeAt(0) - s_code[i] + 1; s_code[i] = "a".charCodeAt(0); }
        }
        if (K <= 0) { break };
    }

    for (var i = 0; i < len; i++) {
        result += String.fromCharCode(s_code[i]);
    }
    console.log(result);
});
//  [javascript]
'use strict';
const inputs = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const CODE_A = 97;
let s = inputs[0];
let K = parseInt(inputs[1]);
let cur = 0;
let result = '';
let lastFailedCur = -1;
let lastFailedCode = -1;

while (cur < s.length) {
	let distance = 26 - (s.charCodeAt(cur) - CODE_A);
	
	if (distance === 26) {
		result += 'a';

	} else if (distance <= K) {
		K -= distance;
		result += 'a';
	} else {
		lastFailedCur = cur;
		lastFailedCode = s.charCodeAt(cur);
		result += s[cur];
	}
	
	cur++;
	
}

if (K > 0) {
	K = K % 26;

	if (lastFailedCode === -1) {
		lastFailedCur = s.length - 1;
		lastFailedCode = result.charCodeAt(result.length - 1);
	}
	
	result = result.substr(0, lastFailedCur) +
		String.fromCharCode(CODE_A + (lastFailedCode + K - CODE_A) % 26) +
		result.substr(lastFailedCur + 1);
}

console.log(result);
//  [javascript]
'use strict';
const i = require("fs").readFileSync("/dev/stdin", "utf8").split("\n");
let s = i[0], p = parseInt(i[1]), code;
for(let j = 0;j < s.length;j++){
  code = s[j].charCodeAt(0);
  if (s.length - 1 === j) {
    code += p%26;
    code += (code > 122)? -26:0;
    s = s.slice(0, j) + String.fromCharCode(code) + s.slice(j+1);
  } else {
    if((123 - code) <= p && !(s[j] === "a")){
      p -= (123 - code);
      s = s.slice(0, j) + "a" + s.slice(j+1);
    }
  }
}
console.log(s);
//  [javascript]
'use strict';
function Main(inputString) {
  let input = inputString.split("\n");
  let string = input[0];
  let point = parseInt(input[1]);
  let which = 0;
  while(point){
    if (string.length - 1 == which) {
      point = point%26;
      var code = (string[which].charCodeAt(0) + point);
      if(code > 122){
        code += (- 122 + 97 - 1);
      }
      var lastLetter = String.fromCharCode(code);
      point = 0;
      string = string.slice(0, which) + lastLetter + string.slice(which+1);
    } else {
      if((27 - (string[which].charCodeAt(0) - 97 + 1)) <= point && !(string[which] == "a")){
        point = point - (27 - (string[which].charCodeAt(0) - 97 + 1));
        string = string.slice(0, which) + "a" + string.slice(which+1);
      }
      ++which;
    }
  }
  console.log(string);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
'use strict';
function Main(is) {
  const i = is.split("\n");
  let s = i[0], p = parseInt(i[1]);
  let code, lastLetter;
  for(let i = 0;i < s.length;i++){
    code = s[i].charCodeAt(0);
    if (s.length - 1 == i) {
      code += p%26;
      if(code > 122){
        code += (- 122 + 97 - 1);
      }
      lastLetter = String.fromCharCode(code);
      s = s.slice(0, i) + lastLetter + s.slice(i+1);
    } else {
      if((27 - (code - 97 + 1)) <= p && !(s[i] == "a")){
        p = p - (27 - (code - 97 + 1));
        s = s.slice(0, i) + "a" + s.slice(i+1);
      }
    }
  }
  console.log(s);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [go]
package main

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

const abcd = "abcdefghijklmnopqrstuvwxyz"

// const ABCD = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}
// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}

// var dx = [...]int{0, 1, 0, -1}
// var dy = [...]int{1, 0, -1, 0}

var inf int = 1e13
var mod = 1000000007

// ---------------------------------------------------------
func main() {
	log.SetFlags(log.Lshortfile)
	next := newScanner()
	s := next.next()
	k := next.Int()
	ans := make([]byte, len(s))
	for i := 0; i < len(s); i++ {
		if s[i] == 'a' {
			ans[i] = 'a'
			continue
		}
		if int('z'-s[i]+1) <= k {
			k -= int('z' - s[i] + 1)
			ans[i] = 'a'
		} else {
			ans[i] = s[i]
		}
	}
	log.Println(k)
	n := int(ans[len(s)-1] - 'a')
	n = (n + k) % len(abcd)
	log.Println(n)
	ans[len(s)-1] = abcd[n]
	fmt.Println(string(ans))
}

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

// Pair is liked C++ pair
type Pair struct {
	a, b int
}

// Pairs is sorted by []Pair struct
type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a < p[j].a {
		return true
	} else if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return false
}

// -------------------------------
func in(c, a, z int) bool {
	return c >= a && c < z
}

func btoi(b bool) int {
	if b {
		return 1
	}
	return 0
}

func itob(a int) bool {
	if a == 0 {
		return false
	}
	return true
}

func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}

func sum(a ...int) int {
	r := a[0]
	if len(a) > 1 {
		for i := 1; i < len(a); i++ {
			r += a[i]
		}
	}
	return r
}

func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}

func minmax(a, b int) (int, int) {
	if a > b {
		return b, a
	}
	return a, b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

// ---------- buffered scanner -----------------------------------------
type scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func newScanner() *scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 10000)
	return &scanner{r: rdr}
}
func (s *scanner) next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *scanner) Line() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *scanner) Int() int {
	v, _ := strconv.Atoi(s.next())
	return v
}
func (s *scanner) Int64() int64 {
	v, _ := strconv.ParseInt(s.next(), 10, 64)
	return v
}
func (s *scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}
//  [go]
package main

import (
	"math/rand"
	"time"
	"os"
	"bufio"
	"fmt"
	"strconv"
	"strings"
)

var(
	inf = 10000000071000000
	sc = bufio.NewScanner(os.Stdin)
	stdin = bufio.NewReader(os.Stdin)
	mod = 1000000007
	mod9 = 1000000009
)

func init()  {
	rand.Seed(time.Now().UnixNano())
	buf := make([]byte, 0) //ここのサイズは何でもよさそう
	sc.Buffer(buf, 1000000009)
}


func main() {
	s := gostring()
	k := goint()
	ans := make([]byte,len(s))
	for i,_ := range s {
		ascii := int(s[i])
		diff := 123 - ascii
		if diff <= k && s[i] != 'a'{
			ans[i] = byte(97)
			k -= diff
		} else {
			ans[i] = s[i]
		}
	}
	n := ((int(ans[len(ans)-1]) - 97 + k) % 26) + 97
	ans[len(ans)-1] = byte(n)
	fmt.Println(string(ans))
}

//||||||||||||||||||||||||||入力|||||||||||||||||||||||||||||||||||||||\
//数字一文字入力
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

//文字列を一行入力
func nextLine() string {
	sc.Scan()
	return sc.Text()
}

//空白区切りの文字列の入力
func spaceLine() []string {
	sc.Scan()
	return strings.Split(sc.Text()," ")
}

//数字を一行入力
func intLine() []int {
	str := spaceLine()
	buf := make([]int,len(str))
	for i,s:=range str{
		buf[i],_ = strconv.Atoi(s)
	}
	return buf
}

//次のスペースか改行まで読み込む
func gostring() string {
	byte_ls := make([]byte,0)
	for  {
		b, _ := stdin.ReadByte()
		if b == 32 || b == 10 || b == 0{
			return string(byte_ls)
		} else if b == 13 {
			continue
		} else {
			byte_ls = append(byte_ls,b)
		}
	}
}

//上の関数のintバージョン
func goint() int {
	n,_ := strconv.Atoi(gostring())
	return n
}

//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

func sum(a ...int) int {
	ans := 0
	for i:=0;i<len(a);i++{
		ans += a[i]
	}
	return ans
}

func min(a ...int) int {
	ans := a[0]
	for i:=1;i<len(a);i++{
		if ans > a[i]{
			ans = a[i]
		}
	}
	return ans
}

func abs(n int) int {
	if n >= 0{
		return n
	} else {
		return -n
	}
}

func max(a ...int) int {
	ans := a[0]
	for i:=1;i<len(a);i++{
		if ans < a[i]{
			ans = a[i]
		}
	}
	return ans
}
//  [go]
package main

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

func min(s []byte, k int64) (int, int64) {
	sl := len(s)
	for i := 0; i < sl; i++ {
		if s[i] == 'a' {
			continue
		}
		if int64(('z'+1)-s[i]) <= k {
			diff := 'z' + 1 - s[i]
			s[i] = 'a'
			return i, k - int64(diff)
		}
	}
	s[sl-1] += byte(k % 26)
	return -1, 0
}

func main() {
	in := bufio.NewReader(os.Stdin)
	s, _ := in.ReadString(byte('\n'))
	s = s[:len(s)-1]
	kstr, _ := in.ReadString(byte('\n'))
	kstr = kstr[:len(kstr)-1]
	k, _ := strconv.ParseInt(kstr, 10, 64)
	b := []byte(s)
	i := 0
	for k > 0 {
		var v int
		v, k = min(b[i:], k)
		i += v
	}
	fmt.Println(string(b))
}
//  [go]
package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
)
 
var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  var line, buffer []byte
  var isPrefix bool = true
  var err error
  for isPrefix {
    line, isPrefix, err = reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
  }
  return string(buffer)
}
func NextInt() int {
  var n int
  n, _ = strconv.Atoi(NextLine())
  return n
}
func NextIntVec() []int {
  L := strings.Split(NextLine(), " ")
  N := make([]int, len(L))
  for i := range N {
    N[i], _ = strconv.Atoi(L[i])
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func Output() {
  _ = writer.Flush()
}

func main() {
  S := NextLine()
  K := NextInt()
  A := ""
  N := len(S)
  for i, s := range S {
    if i == N - 1 {
      A += string((int(s) + K - int('a')) % 26 + int('a'))
      break
    }
    k := int('z') + 1 - int(s)
    if K < k || s == 'a' { 
      A += string(s)
      continue
    }
    K -= k
    A += "a"
  }
  Write(A)
  Output()
}
//  [go]
package main

import "fmt"

func main() {
	var s string
	var k int
	fmt.Scan(&s, &k)
	ans := ""
	for i := 0; i < len(s)-1; i++ {
		d := 26 - (s[i] - 'a')
		var c byte
		if s[i] == 'a' {
			c = 'a'
		} else if k >= int(d) {
			k -= int(d)
			c = 'a'
		} else {
			c = s[i]
		}
		ans += string(c)
	}
	if k > 0 {
		k %= 26
		ans += string('a' + (s[len(s)-1]-'a'+byte(k))%26)
	} else {
		ans += string(s[len(s)-1])
	}
	fmt.Println(ans)
}
//  [go]
package main

import (
	"fmt"
)

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

	var cnt int
	var ans string
	for i, c := range s {
		d := 'z' - c + 1
		if i != len(s)-1 {
			if c != 'a' && cnt+int(d) <= k {
				c = 'a'
				cnt += int(d)
			}
		} else {
			e := int32(k-cnt) % 26
			if c+e > 'z' {
				c = c + e - 26
			} else {
				c = c + e
			}
		}
		ans += string(c)
	}

	fmt.Println(ans)
}
//  [ruby]
s=gets.chop
k=gets.to_i
res=''
i=0
s.bytes{|b|
    x=b-97
    if x>0 and k>=26-x
        res<<?a
        k-=26-x
    else
        res<<s[i]
    end
    i+=1
}
res[-1]=((res[-1].ord-97+k%26)+97).chr
puts res
//  [ruby]
s = gets.chomp
k = gets.to_i
a = "a".ord
z = "z".ord

s = s.each_byte.map do |c|
    if c == a
        c.chr
    elsif z - c < k
        k -= z - c + 1
        a.chr
    else
        c.chr
    end
end

k %= 26
s[-1] = (s[-1].ord + k).chr
puts s.join
//  [ruby]
s=gets.chop
k=gets.to_i
res=[]
i=0
s.bytes{|b|
    x=b-97
    if x>0 and k>=26-x
        res<<?a
        k-=26-x
    else
        res<<s[i]
    end
    i+=1
}
res[-1]=((res[-1].ord-97+k%26)+97).chr
puts res*''
//  [ruby]
s = gets.chomp
k = gets.to_i
as = ('a'..'z').to_a
alps = Hash[as.map.with_index{ |a,i| [a,i] }]
(0...s.size).each{ |i|
  v = alps[s[i]]
  c = (26 - v) % 26
  if c <= k
    k -= c
    s[i] = 'a'
  end
}
#$stderr.puts s,k
s[-1] = as[(alps[s[-1]] + k) % 26]
puts s
//  [ruby]
io = STDIN
s=io.gets.chomp
k=io.gets.chomp.to_i
hash= ("a".."z").zip([0]+(1..25).to_a.reverse).to_h
s.size.times do |i|
  ss = s[i]
  j = hash[s[i]]
  if s.size-1 == i
    if j <= (k%26)
      ss="a"
      (k%26-j).times{ss.succ!}
    else
      (k%26).times{ss.succ!}
    end
    s[i]=ss[0]
    k=0
  else
    if j <= k
      j.times{ss.succ!}
      s[i] = ss[0]
      k-=j
    end
  end
  break if k<=0
end
puts s
//  [ruby]
a=[*?a..?z]
s=gets.chomp
n=gets.to_i
l=s.length
l.times do |i|
  g=26-a.index(s[i])
  if g<=n && g!=26
    n-=g
    s[i]=?a
  end
end
g=a.index(s[-1])
s[-1]=a[(g+n)%26]
puts s
//  [rust]
pub 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()
}

pub fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

pub fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

pub fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn main() {
    let s: String = read();
    let mut k: u32 = read();
    let cv: Vec<char> = s.chars().collect();
    let mut ansv: Vec<char> = vec![];
    let l = s.len();
    for i in 0..l - 1 {
        let c = cv[i];
        let t = (('z' as u32) + 1 - (c as u32)) % 26;
        if t > k {
            ansv.push(c);
        } else {
            k -= t;
            ansv.push('a');
        }
    }
    let c = cv[l - 1];
    let k = (k % 26) as u8;
    let tmp = (c as u8 - 'a' as u8 + k) % 26;
    let c = (((c as u8 - 'a' as u8 + k) % 26) + 'a' as u8) as char;
    ansv.push(c);
    let ans: String = ansv.into_iter().collect();
    println!("{}", ans);
}
//  [rust]
#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

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

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      mut s: chars,
      mut k: usize,
    }
    const NUM: u8 = 26;
    let n = s.len();
    for i in 0..n {
        let c = (s[i] as u8) - 'a' as u8;
        if c == 0 {
            continue;
        }
        let req = (NUM - c) as usize;
        if k >= req {
            s[i] = 'a';
            k -= req;
        }
    }
    if k > 0 {
        let c = ((s[n-1] as u8) - 'a' as u8 + (k%NUM as usize) as u8) % NUM;
        s[n-1] = (c + 'a' as u8) as char;
    }
    let ans = s.into_iter().collect::<String>();
    puts!("{}\n", ans);
}
//  [rust]
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        s: Chars,
        mut k: usize,
    }

    let mut ans = vec![];
    for &ns in &s {
        if ns != 'a' {
            let bet_a = ('z' as u8 + 1 - ns as u8) as usize;
            if bet_a <= k {
                k -= bet_a;
                ans.push('a');
            } else {
                ans.push(ns);
            }
        } else {
            ans.push('a');
        }
    }

    if ans.iter().filter(|c| **c == 'a').count() == ans.len() {
        ans.pop();
        let add = k % 26;
        let c = ('a' as u8 + add as u8) as char;
        ans.push(c)
    } else {
        let mut c = ans.pop().unwrap();
        c = (c as u8 + k as u8) as char;
        ans.push(c);
    }

    for &a in &ans {
        print!("{}", a);
    }
    println!();
}
//  [swift]
extension String {
    var asciiValue: UInt32 {
        guard let first = characters.first where characters.count == 1 else  { return 0 }
        return first.unicodeScalarsValue!
    }
    func asciiValueAt(pos pos: UInt32) -> UInt32 {
        guard characters.count > 0 && Int(pos) < characters.count else  { return 0 }
        return Array(characters)[Int(pos)].unicodeScalarsValue!
    }
}
extension Character {
    var unicodeScalarsValue: UInt32? {
        return String(self).unicodeScalars.first?.value
    }
}

var ss = Array(readLine()!.characters)
var K = Int(readLine()!)!

for i in 0 ..< ss.count {
    let number = Int(ss[i].unicodeScalarsValue!)
    if number == 97 {
        continue
    }
    let to = 123 - number
    if to <= K {
        K -= to
        ss[i] = Character("a")
    }
}

if K == 0 {
    print(String(ss))
} else {
    let last = ss.count - 1
    let unicodeScalar = UnicodeScalar((Int(ss[last].unicodeScalarsValue!) + K - 97) % 26 + 97)
    ss[last] = Character(unicodeScalar)
    print(String(ss))
}
//  [swift]
import Foundation

let str = readLine(stripNewline: true)
var no_oper = Int(readLine(stripNewline: true)!)!

let characterString = str!
var numbers: [Int] = Array<Int>()

for (i, character) in characterString.utf8.enumerate() {
    let stringSegment: String = "\(character)"
    let anInt: Int = Int(stringSegment)! % 97
    
    if anInt != 0 {
        if (26 - anInt) <= no_oper {
            numbers.append(0)
            no_oper -= (26 - anInt)
        } else {
            numbers.append(anInt)
        }
    } else {
        numbers.append(anInt)
    }
}

numbers[numbers.count - 1] = (numbers[numbers.count - 1] + no_oper) % 26

var string = ""
for number in numbers {
    let char = Character(UnicodeScalar(number + 97))
    string.append(char)
}

print(string)
//  [typescript]
import * as fs from 'fs';

export class Reader {
    lines: string[];
    currentLine: number;

    constructor() {
        this.lines = fs.readFileSync("/dev/stdin", "utf8").trim().split("\n");
        this.currentLine = 0;
    }

    readLine(): string {
        return this.lines[this.currentLine++];
    }

	readChars(): string[] {
		let S = this.readLine();
		return new Array(S.length).fill(null).map((_, i) => S.charAt(i));
	}

    readInt(): number {
        return Number(this.readLine());
    }

    readInts(): number[] {
        return this.readLine().split(" ").map(Number);
    }
}

let reader = new Reader();
let S = reader.readChars();
let K = reader.readInt();

let i = 0;
let alphabets = "abcdefghijklmnopqrstuvwxyz";

while (K > 0) {
	if (i == S.length-1) {
		S[i] = alphabets[(alphabets.indexOf(S[i])+K)%26];
		K = 0;
	} else if (S[i] == 'a') {
		i += 1;
	} else {
		if ((26-alphabets.indexOf(S[i])) <= K) {
			K = K-(26-alphabets.indexOf(S[i]));
			S[i] = 'a';
		}
		i += 1;
	}
}

console.log(S.join(""));
//  [python]
# coding : utf-8

import numpy as np

N = int(input())
D =input().split()
X = int(D[1])
D = int(D[0])

A = [int(input()) for i in range(N)]
suml = 0

for a in A:
    for i in range(D):
        if i*a + 1 <= D:
            suml += 1
        else:
            break
print(suml+X)
//  [python]
import sys
import numpy as np
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@jit
def main(n, d, x, a):
  ans = n + x
  for i in a:
    ans += (d-1)//i
  return ans

n,d,x,*a = map(int, read().split())
print(main(n,d,x,a))
//  [python]
import numpy as np

N = int(input())
D,X = map(int,input().split(' '))

res = np.zeros(N)

for i in range(N):
    res[i] = (D-1) // int(input()) + 1

print(int(np.sum(res)+X))
//  [java]
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] arg) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int d = sc.nextInt();
		int x = sc.nextInt();
		int a[] = new int[n];

		IntStream.range(0, n).forEach(i -> a[i] = sc.nextInt());

		int sum = x;
		for (int i = 0; i < n; i++) {
			if ((d % a[i]) == 0) {
				sum += (d / a[i]);
			} else {
				sum += (d / a[i]) + 1;
			}
		}
		System.out.println(sum);
	}
}
//  [java]
import java.io.*;
import java.util.*;
/*
 * 	Heart beats fast
 * 		Colors and promises
 * 			How to be brave
 * 				How can I love when I am afraid to fall...
 */
public class Main 
{
	static final int mod=1000000007;
	static final double eps=1e-8;
	static final long inf=100000000000000000L;
	static final boolean debug=true;
	static Reader in=new Reader();
	public static void main(String[] args) throws IOException
	{
		int n=ni();
		int d=ni(),x=ni();
		int a[]=new int[n];
		int an=0;
		for(int i=0; i<n; i++)
		{
			a[i]=ni();
			an++;
			an+=(d-1)/a[i];
		}
		pr(an+x);
		System.out.println(ans);
	}
	static StringBuilder ans=new StringBuilder();
	static long powm(long a, long b, long m)
	{
		long an=1;
		long c=a;
		while(b>0)
		{
			if(b%2==1)
				an=(an*c)%m;
			c=(c*c)%m;
			b>>=1;
		}
		return an;
	}
	static Random rn=new Random();
	static void pd(){if(debug)ans.append("hola");}
	static void pd(Object a){if(debug)ans.append(a+"\n");}
	static void pr(Object a){ans.append(a+"\n");}
	static void pr(){ans.append("\n");}
	static void p(Object a){ans.append(a);}
	static int ni(){return in.nextInt();}
	static long nl(){return in.nextLong();}
	static String ns(){return in.next();}
	static double nd(){return in.nextDouble();}
	static String pr(String a, long b)
	{
		String c="";
		while(b>0)
		{
			if(b%2==1)
				c=c.concat(a);
			a=a.concat(a);
			b>>=1;
		}
		return c;
	}
	static class Reader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public Reader() {
            reader = new BufferedReader(new InputStreamReader(System.in), 32768);
            tokenizer = null;
        }
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
        	return Long.parseLong(next());
        }
        public double nextDouble() {
        	return Double.parseDouble(next());
        }
    }
}
//  [java]
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author mikit
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BChocolate solver = new BChocolate();
        solver.solve(1, in, out);
        out.close();
    }

    static class BChocolate {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt(), d = in.nextInt();
            long ans = in.nextLong()
                    + IntStream.range(0, n)
                    .map(x -> divceil(d, in.nextInt()))
                    .sum();
            out.println(ans);
        }

        public int divceil(int a, int b) {
            return (a + b - 1) / b;
        }

    }
}
//  [cpp]
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define EACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class Value>using vec = vector< Value >;
using ll = long long;
using P = pair< long long, long long >;
#define fi first
#define se second
#define el endl
#pragma endregion

void Main();

int main(){
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}
void Main(){
    ll N, D, X;
    cin >> N >> D >> X;
    REP(i, N){
        int A;
        cin >> A;
        X+=1+((D-1)/A);
    }
    cout << X << el;
}
//  [cpp]
#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>


using namespace std;

int main(){
  int n,d,x;
  cin>>n;
  cin>>d>>x;
  int a[n];
  for(int i=0;i<n;i++)cin>>a[i];
  int ans=x;
  for(int i=0;i<d;i++){
    for(int j=0;j<n;j++){
      if(i%a[j]==0)ans++;
    }
  }

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

int main(){

int N,D,X;
int ans=0,j=1;
scanf("%d",&N);
scanf("%d%d",&D,&X);
int A[N];
for (int i = 0; i < N; i++)
{
  scanf("%d",&A[i]);
}

for (int i = 0; i < N; i++)
{
  while (j*A[i]+1<=D)
  {
    ans++;
    j++;
  }
  j=1;
}

printf("%d",ans+X+N);

return 0;

}
//  [c]
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
    
    int n, d, x, a[max];
    int sum=0;
    
    scanf("%d%d%d", &n, &d, &x);
    rep(i, n){
        scanf("%d", &a[i]);
    }
    
    rep(j, n){
        rep(i, d){
            if (i*a[j]+1<=d) {
                sum+=1;
            } else {
                break;
            }
        }
    }
    
    printf("%d", x+sum);
    
    return 0;
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int N, D, X;

    scanf("%d%d%d", &N, &D, &X);

    int A[N];
    int ans = X;

    for(int i = 0; i < N; i++){
        scanf("%d", &A[i]);
        ans += (D-1) / A[i] + 1;
    }

    printf("%d\n", ans);

    return 0;
}
//  [javascript]
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}

//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i, no){
  switch(no){
    case 0: return i;
    case 1: return parseInt(i);
    case 2: return i.split(" ");
    case 3: return i.split("\n");
    case 4: return i.split(" ").map((a)=>Number(a));
    case 5: return i.split("\n").map((a)=>Number(a));
    case 6: return i.split("");
    case 7: return i.split("").map((a)=>Number(a));
  }}
function Main(input) {
  input = myconv(input, 3);
  const N = myconv(input[0], 1);
  const D = myconv(input[1], 4)[0];
  const X = myconv(input[1], 4)[1];
  var ans = 0;
  input.shift();
  input.shift();
  input = input.map((a)=>Number(a));
  for(var i = 0; i < N; i++){
    var tmp = 1;
    while (tmp <= D){
      ans++;
      tmp += input[i];
    }
  }
  console.log(ans + X);
}
Main(myin());