int main(void){
    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    
    NSData   *allData = [[NSFileHandle fileHandleWithStandardInput] readDataToEndOfFile];
    NSString *allText = [[NSString alloc]
                         initWithBytes:[allData bytes]
                         length:[allData length]
                         encoding:NSUTF8StringEncoding];
    NSArray *allLines = [allText componentsSeparatedByString:@"\n"];
    
    NSArray *inputs = [allLines[0] componentsSeparatedByString:@" "];
    
    NSInteger a = [inputs[0] intValue];
    NSInteger b = [inputs[1] intValue];
    
    NSInteger count = 0;
    for (NSInteger i = 1; i <= a; i++) {
        if i <= b {
            count++
        }
    }
    
    NSString *s = [NSString stringWithFormat:@"%ld", count];
    
    [[NSFileHandle fileHandleWithStandardOutput] writeData: [s dataUsingEncoding: NSUTF8StringEncoding]];
    [pool release];
    return 0;
}