Problem:
Score: 200 points

Problem Statement

The number 105 is quite special - it is odd but still it has eight divisors.
Now, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?

Constraints

N is an integer between 1 and 200 (inclusive).

Input

Input is given from Standard Input in the following format:

N

Output

Print the count.

Sample Input 1

105

Sample Output 1

1

Among the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.

Sample Input 2

7

Sample Output 2

0

1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.

Solution in C# (Mono 4.6.2.0) (judge verdict: Wrong Answer)


using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
	// http://abc106.contest.atcoder.jp/tasks/abc106_b
	public class Abc106_b
	{
#if !Development
		public static void Main(string[] args)
		{
			Abc106_b.Solve(args);
		}
#endif

		public static void Solve(string[] args)
		{
			var n = ReadLineIntOne();

			var answer = Enumerable.Range(0, n / 2 + 1)
			                       .Select(x => (x * 2) + 1)
								   .Where(x =>
								   {
									    var count = 0;
										foreach(var i in Enumerable.Range(1, (int)Math.Sqrt(x)))
										{
											if (x / i == (float)x / i)
											{
											    count++;
												if (x / (x / i) != x / i)
												{
												    count++;
												}
											}

										}
				//if (x > 95)
				//Console.WriteLine("x " + x + " " + count + " " );

										return count == 8;
			}).Count();
			
			Console.WriteLine(answer);
		}

		public static List<string> ReadLineString() { return Console.ReadLine().Split(' ').ToList(); }
		public static List<int> ReadLineInt() { return Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToList(); }
		public static int ReadLineIntOne() { return Console.ReadLine().Split(' ').Select(str => int.Parse(str)).First(); }
		public static List<int> MultiReadLineInt(int lineNum) { return Enumerable.Range(0, lineNum).Select(_ => ReadLineIntOne()).ToList(); }
	}
}