#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int i = 1;
  int answer = 0;
  int time = 0;
  while (time + k <= 240 && i <= n) {
    time += 5 * i;
    i++;
    if (time + k > 240)
      break;
    answer++;
  }
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
add    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    $0xf0,%ecx
mov    %al,-0x19(%rbp)
jg     117b <main+0x5b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    118b <main+0x6b>
jmp    11c2 <main+0xa2>
imul   $0x5,-0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0xf0,%eax
jle    11b4 <main+0x94>
jmp    11c2 <main+0xa2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <main+0x38>
mov    -0x14(%rbp),%esi
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%r8d
xor    %esi,%esi
cmp    $0xf0,%r8d
jg     1177 <main+0x57>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    1177 <main+0x57>
xor    %edx,%edx
mov    $0x5,%edi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nop
add    %edi,%edx
lea    (%rdx,%r8,1),%eax
cmp    $0xf0,%eax
jg     1177 <main+0x57>
add    $0x1,%esi
add    $0x5,%edi
cmp    %ecx,%esi
jl     1160 <main+0x40>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %31, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
%12 = icmp sle i32 %11, 240
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br label %17
17: ; preds = %13, %8
%18 = phi i1 [ false, %8 ], [ %16, %13 ]
br i1 %18, label %19, label %34
19: ; preds = %17
%20 = load i32, i32* %4
%21 = mul nsw i32 5, %20
%22 = load i32, i32* %6
%23 = add nsw i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
%26 = load i32, i32* %6
%27 = load i32, i32* %3
%28 = add nsw i32 %26, %27
%29 = icmp sgt i32 %28, 240
br i1 %29, label %30, label %31
30: ; preds = %19
br label %34
31: ; preds = %19
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %8
34: ; preds = %30, %17
%35 = load i32, i32* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp slt i32 %6, 241
%9 = icmp sgt i32 %7, 0
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %11, label %23
11: ; preds = %0, %19
%12 = phi i32 [ %16, %19 ], [ 0, %0 ]
%13 = phi i32 [ %21, %19 ], [ 0, %0 ]
%14 = phi i32 [ %20, %19 ], [ 1, %0 ]
%15 = mul nsw i32 %14, 5
%16 = add nuw nsw i32 %12, %15
%17 = add nsw i32 %16, %6
%18 = icmp sgt i32 %17, 240
br i1 %18, label %23, label %19
19: ; preds = %11
%20 = add nuw nsw i32 %14, 1
%21 = add nuw nsw i32 %13, 1
%22 = icmp slt i32 %14, %7
br i1 %22, label %11, label %23
23: ; preds = %19, %11, %0
%24 = phi i32 [ 0, %0 ], [ %13, %11 ], [ %21, %19 ]
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
ret i32 0
}