import java.util.Scanner;
import java.math.*;
import java.util.*;

public class JavaAcm
{
	public static void main(String args[])
	{
		Scanner scan = new Scanner(System.in);
		int i , k , b , n , t , sum = 1;
		k = scan.nextInt();
		b = scan.nextInt();
		n = scan.nextInt();
		t = scan.nextInt();
		i = n;
		while(sum <= t)
		{
			i --;
			sum *= 3;
		}
		if(i < 0)
	       i = 0;
		System.out.println(i);
	}
}