import java.util.Scanner;

public class AboutBacteria {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt(), b = sc.nextInt(), n = sc.nextInt();
		long t = sc.nextLong();
		long z = 1;
		for (int i = 0; i < n; i++)
			z = (z * k) + b;
		int i = 0;
		while (t < z) {
			t = (t * k) + b;
			i++;
		}
		System.out.println(i);
		System.exit(0);
	}
}
