import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	}

} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long A = Long.parseLong(sc.next()); A Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc String str = sc.next(); str sc.next() sc.next sc int[] tmp = new int[3]; tmp new int[3] 3 tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0))) tmp[0] tmp 0 Integer.parseInt(String.valueOf(str.charAt(0))) Integer.parseInt Integer String.valueOf(str.charAt(0)) String.valueOf String str.charAt(0) str.charAt str 0 tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2))) tmp[1] tmp 1 Integer.parseInt(String.valueOf(str.charAt(2))) Integer.parseInt Integer String.valueOf(str.charAt(2)) String.valueOf String str.charAt(2) str.charAt str 2 tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3))) tmp[2] tmp 2 Integer.parseInt(String.valueOf(str.charAt(3))) Integer.parseInt Integer String.valueOf(str.charAt(3)) String.valueOf String str.charAt(3) str.charAt str 3 sc.close() sc.close sc long a = A * tmp[0]; a A * tmp[0] A tmp[0] tmp 0 long b = A * tmp[1]; b A * tmp[1] A tmp[1] tmp 1 long c = A * tmp[2]; c A * tmp[2] A tmp[2] tmp 2 long tmpb = b / 10; tmpb b / 10 b 10 long tmpc = c / 100; tmpc c / 100 c 100 long tmpb2 = (b % 10) * 10; tmpb2 (b % 10) * 10 (b % 10) b 10 10 long tmpc2 = c % 100; tmpc2 c % 100 c 100 long tmpx = (tmpb2 + tmpc2) / 100; tmpx (tmpb2 + tmpc2) / 100 (tmpb2 + tmpc2) tmpb2 tmpc2 100 long ans = a + tmpb + tmpc + tmpx; ans a + tmpb + tmpc + tmpx tmpc a + tmpb + tmpc + tmpx a tmpb tmpc tmpx System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	}

} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long A = Long.parseLong(sc.next());
		String str = sc.next();

		int[] tmp = new int[3];
		tmp[0] = Integer.parseInt(String.valueOf(str.charAt(0)));
		tmp[1] = Integer.parseInt(String.valueOf(str.charAt(2)));
		tmp[2] = Integer.parseInt(String.valueOf(str.charAt(3)));
		sc.close();


		long a = A * tmp[0];
		long b = A * tmp[1];
		long c = A * tmp[2];

		long tmpb = b / 10;
		long tmpc = c / 100;

		//小数点以下の計算
		long tmpb2 = (b % 10) * 10;
		long tmpc2 = c % 100;
		//繰り上がりで1足されるかどうか確認
		long tmpx = (tmpb2 + tmpc2) / 100;

		long ans = a + tmpb + tmpc + tmpx;
		System.out.println(ans);

	}

}