#include <bits/stdc++.h>
using namespace std;
const int f[1501] = {
    0,    8978, 7923, 7622, 7393, 7260, 7254, 7086, 7007, 6966, 6928, 6868,
    6770, 6823, 6730, 6676, 6755, 6656, 6575, 6642, 6591, 6618, 6498, 6547,
    6509, 6519, 6423, 6431, 6445, 6407, 6433, 6399, 6391, 6340, 6381, 6417,
    6320, 6287, 6273, 6341, 6278, 6254, 6257, 6285, 6322, 6223, 6225, 6253,
    6234, 6194, 6174, 6213, 6157, 6188, 6170, 6171, 6181, 6178, 6196, 6182,
    6176, 6094, 6201, 6045, 6166, 6070, 6091, 6093, 6065, 6083, 6073, 6041,
    6120, 6043, 6072, 6025, 6018, 5949, 6009, 6057, 6106, 5984, 6024, 6047,
    5981, 6051, 5960, 6032, 6021, 5994, 5995, 5942, 6003, 5909, 6008, 5992,
    5989, 5938, 5935, 5968, 5984, 5917, 5880, 5961, 5928, 5914, 5905, 5994,
    5906, 5928, 5986, 5836, 5855, 5932, 5876, 5907, 5935, 5909, 5866, 5852,
    5860, 5870, 5962, 5862, 5884, 5858, 5857, 5838, 5837, 5894, 5848, 5840,
    5884, 5891, 5855, 5866, 5830, 5828, 5853, 5797, 5842, 5844, 5828, 5837,
    5834, 5829, 5774, 5872, 5778, 5771, 5899, 5824, 5849, 5842, 5793, 5783,
    5753, 5783, 5789, 5766, 5784, 5792, 5734, 5775, 5781, 5791, 5788, 5778,
    5777, 5760, 5799, 5654, 5722, 5779, 5712, 5786, 5709, 5809, 5721, 5808,
    5682, 5742, 5780, 5801, 5715, 5711, 5823, 5720, 5672, 5725, 5747, 5801,
    5771, 5680, 5779, 5723, 5708, 5744, 5740, 5741, 5662, 5705, 5726, 5711,
    5775, 5667, 5724, 5656, 5711, 5684, 5642, 5688, 5750, 5644, 5663, 5647,
    5684, 5672, 5742, 5620, 5771, 5652, 5658, 5678, 5694, 5673, 5604, 5737,
    5668, 5674, 5632, 5610, 5705, 5624, 5720, 5727, 5645, 5642, 5682, 5663,
    5681, 5666, 5643, 5672, 5609, 5666, 5643, 5663, 5665, 5621, 5666, 5628,
    5605, 5681, 5644, 5611, 5579, 5693, 5609, 5590, 5609, 5650, 5591, 5593,
    5640, 5596, 5584, 5649, 5559, 5601, 5659, 5628, 5555, 5629, 5586, 5635,
    5628, 5579, 5555, 5646, 5627, 5702, 5531, 5566, 5650, 5522, 5578, 5669,
    5615, 5542, 5613, 5556, 5616, 5590, 5563, 5567, 5565, 5502, 5605, 5602,
    5625, 5565, 5605, 5607, 5626, 5573, 5496, 5564, 5537, 5549, 5567, 5636,
    5585, 5508, 5574, 5544, 5589, 5549, 5533, 5612, 5585, 5604, 5617, 5501,
    5549, 5560, 5583, 5540, 5589, 5577, 5532, 5600, 5555, 5548, 5569, 5511,
    5507, 5601, 5587, 5516, 5583, 5512, 5557, 5560, 5580, 5507, 5590, 5526,
    5546, 5548, 5489, 5556, 5505, 5569, 5496, 5485, 5534, 5543, 5565, 5461,
    5557, 5537, 5542, 5549, 5555, 5540, 5459, 5530, 5535, 5521, 5489, 5459,
    5563, 5537, 5526, 5503, 5489, 5536, 5584, 5509, 5562, 5491, 5476, 5509,
    5489, 5545, 5529, 5525, 5466, 5458, 5480, 5500, 5529, 5485, 5497, 5437,
    5512, 5467, 5507, 5525, 5432, 5497, 5540, 5476, 5486, 5499, 5560, 5446,
    5510, 5508, 5554, 5452, 5461, 5494, 5494, 5553, 5392, 5449, 5506, 5468,
    5633, 5413, 5491, 5488, 5443, 5492, 5434, 5504, 5537, 5477, 5395, 5502,
    5458, 5487, 5402, 5455, 5509, 5469, 5483, 5493, 5518, 5454, 5494, 5398,
    5516, 5464, 5487, 5475, 5446, 5408, 5450, 5412, 5515, 5466, 5419, 5407,
    5455, 5513, 5342, 5466, 5451, 5489, 5459, 5466, 5507, 5424, 5429, 5453,
    5430, 5374, 5503, 5480, 5382, 5462, 5448, 5536, 5396, 5443, 5505, 5400,
    5484, 5453, 5396, 5422, 5480, 5448, 5422, 5399, 5470, 5417, 5459, 5413,
    5411, 5471, 5384, 5407, 5452, 5401, 5434, 5412, 5444, 5435, 5384, 5413,
    5436, 5433, 5420, 5427, 5381, 5431, 5438, 5415, 5518, 5399, 5412, 5434,
    5359, 5398, 5413, 5380, 5471, 5429, 5468, 5404, 5394, 5412, 5408, 5426,
    5415, 5389, 5375, 5436, 5373, 5437, 5358, 5371, 5493, 5451, 5364, 5461,
    5317, 5420, 5426, 5447, 5446, 5404, 5437, 5378, 5424, 5430, 5464, 5345,
    5333, 5385, 5438, 5416, 5403, 5388, 5372, 5466, 5445, 5465, 5397, 5319,
    5453, 5342, 5430, 5352, 5340, 5346, 5324, 5381, 5382, 5327, 5476, 5339,
    5399, 5387, 5400, 5378, 5364, 5389, 5410, 5310, 5327, 5391, 5348, 5419,
    5411, 5347, 5367, 5434, 5373, 5408, 5296, 5370, 5408, 5389, 5401, 5363,
    5364, 5328, 5336, 5355, 5378, 5399, 5413, 5325, 5423, 5307, 5355, 5348,
    5370, 5358, 5397, 5406, 5413, 5396, 5371, 5366, 5388, 5348, 5412, 5310,
    5398, 5363, 5351, 5367, 5320, 5385, 5365, 5372, 5325, 5385, 5328, 5378,
    5404, 5344, 5374, 5376, 5359, 5374, 5335, 5361, 5443, 5399, 5362, 5329,
    5397, 5418, 5275, 5284, 5346, 5284, 5416, 5376, 5336, 5419, 5371, 5360,
    5330, 5349, 5357, 5377, 5328, 5303, 5411, 5287, 5362, 5294, 5355, 5332,
    5390, 5361, 5347, 5354, 5355, 5308, 5294, 5342, 5291, 5304, 5321, 5404,
    5353, 5289, 5272, 5364, 5391, 5372, 5206, 5319, 5271, 5350, 5296, 5389,
    5358, 5329, 5419, 5364, 5366, 5376, 5271, 5312, 5275, 5305, 5260, 5406,
    5312, 5369, 5321, 5341, 5377, 5250, 5328, 5310, 5334, 5396, 5306, 5344,
    5337, 5343, 5382, 5297, 5309, 5308, 5331, 5327, 5308, 5300, 5366, 5330,
    5328, 5320, 5324, 5340, 5313, 5334, 5353, 5233, 5326, 5301, 5298, 5328,
    5291, 5281, 5310, 5313, 5312, 5329, 5299, 5298, 5282, 5297, 5308, 5232,
    5300, 5313, 5279, 5331, 5332, 5245, 5197, 5289, 5333, 5274, 5314, 5278,
    5348, 5358, 5319, 5322, 5282, 5286, 5251, 5336, 5274, 5263, 5373, 5254,
    5292, 5395, 5302, 5309, 5336, 5300, 5207, 5329, 5349, 5237, 5293, 5268,
    5320, 5183, 5250, 5318, 5303, 5241, 5363, 5269, 5307, 5283, 5286, 5326,
    5237, 5338, 5366, 5214, 5299, 5274, 5246, 5268, 5335, 5296, 5312, 5257,
    5276, 5320, 5320, 5349, 5328, 5223, 5324, 5268, 5268, 5269, 5226, 5276,
    5289, 5234, 5329, 5200, 5329, 5301, 5261, 5254, 5292, 5246, 5290, 5257,
    5313, 5260, 5280, 5257, 5302, 5279, 5374, 5313, 5318, 5235, 5229, 5339,
    5272, 5262, 5190, 5283, 5301, 5308, 5262, 5269, 5232, 5317, 5282, 5262,
    5276, 5253, 5321, 5302, 5301, 5230, 5280, 5271, 5265, 5268, 5233, 5269,
    5280, 5287, 5308, 5218, 5266, 5227, 5306, 5229, 5294, 5275, 5287, 5295,
    5227, 5261, 5320, 5307, 5225, 5252, 5279, 5285, 5290, 5286, 5255, 5349,
    5289, 5255, 5229, 5268, 5234, 5182, 5232, 5317, 5217, 5284, 5292, 5287,
    5167, 5201, 5275, 5198, 5283, 5210, 5264, 5272, 5229, 5254, 5309, 5277,
    5300, 5250, 5294, 5272, 5187, 5220, 5278, 5290, 5201, 5243, 5247, 5287,
    5297, 5253, 5239, 5199, 5253, 5334, 5181, 5241, 5290, 5177, 5331, 5265,
    5252, 5245, 5302, 5229, 5237, 5159, 5160, 5156, 5265, 5218, 5236, 5195,
    5196, 5213, 5245, 5262, 5292, 5281, 5284, 5161, 5264, 5275, 5242, 5243,
    5240, 5217, 5258, 5289, 5258, 5181, 5247, 5271, 5226, 5217, 5209, 5265,
    5176, 5232, 5178, 5204, 5200, 5194, 5258, 5193, 5245, 5265, 5289, 5147,
    5182, 5335, 5206, 5172, 5295, 5350, 5163, 5260, 5200, 5195, 5329, 5241,
    5176, 5233, 5289, 5280, 5229, 5212, 5172, 5214, 5240, 5286, 5195, 5247,
    5255, 5190, 5178, 5282, 5230, 5257, 5174, 5214, 5171, 5254, 5188, 5237,
    5211, 5245, 5190, 5262, 5160, 5261, 5264, 5205, 5162, 5187, 5175, 5204,
    5254, 5179, 5178, 5225, 5266, 5314, 5185, 5260, 5239, 5170, 5172, 5197,
    5296, 5265, 5205, 5217, 5242, 5167, 5267, 5235, 5234, 5265, 5209, 5223,
    5215, 5185, 5225, 5245, 5158, 5177, 5255, 5260, 5269, 5224, 5215, 5220,
    5245, 5262, 5251, 5192, 5192, 5197, 5196, 5244, 5121, 5227, 5160, 5271,
    5174, 5143, 5217, 5161, 5188, 5258, 5200, 5163, 5190, 5255, 5251, 5154,
    5163, 5171, 5220, 5247, 5158, 5261, 5159, 5255, 5160, 5274, 5233, 5192,
    5213, 5153, 5304, 5196, 5105, 5192, 5282, 5195, 5160, 5329, 5205, 5107,
    5169, 5210, 5222, 5205, 5174, 5192, 5285, 5234, 5246, 5211, 5110, 5068,
    5178, 5203, 5142, 5136, 5272, 5177, 5203, 5142, 5198, 5155, 5205, 5228,
    5161, 5223, 5235, 5109, 5188, 5189, 5179, 5217, 5247, 5173, 5194, 5191,
    5249, 5194, 5134, 5126, 5220, 5204, 5141, 5189, 5131, 5179, 5209, 5231,
    5158, 5235, 5254, 5133, 5170, 5245, 5176, 5175, 5244, 5205, 5173, 5181,
    5241, 5145, 5185, 5246, 5197, 5134, 5264, 5167, 5135, 5183, 5181, 5165,
    5144, 5196, 5252, 5249, 5114, 5202, 5225, 5200, 5196, 5118, 5199, 5116,
    5117, 5154, 5125, 5200, 5105, 5180, 5194, 5201, 5203, 5160, 5151, 5212,
    5198, 5268, 5188, 5206, 5202, 5156, 5148, 5133, 5140, 5185, 5146, 5190,
    5177, 5109, 5190, 5111, 5173, 5151, 5254, 5156, 5189, 5193, 5182, 5165,
    5109, 5161, 5166, 5171, 5164, 5117, 5239, 5262, 5103, 5151, 5145, 5144,
    5124, 5229, 5085, 5177, 5108, 5157, 5181, 5228, 5250, 5112, 5144, 5167,
    5189, 5189, 5192, 5226, 5145, 5179, 5148, 5194, 5158, 5186, 5147, 5123,
    5128, 5274, 5190, 5211, 5134, 5091, 5207, 5144, 5175, 5211, 5213, 5162,
    5145, 5198, 5190, 5071, 5125, 5182, 5174, 5189, 5182, 5224, 5200, 5147,
    5175, 5112, 5136, 5207, 5196, 5242, 5118, 5208, 5229, 5148, 5096, 5182,
    5112, 5189, 5195, 5118, 5128, 5229, 5139, 5239, 5174, 5190, 5186, 5153,
    5095, 5098, 5125, 5156, 5159, 5150, 5185, 5103, 5170, 5162, 5113, 5238,
    5128, 5222, 5141, 5188, 5070, 5098, 5126, 5111, 5217, 5181, 5132, 5131,
    5089, 5137, 5140, 5224, 5116, 5120, 5186, 5153, 5081, 5117, 5101, 5172,
    5202, 5147, 5184, 5190, 5152, 5143, 5188, 5146, 5078, 5179, 5167, 5127,
    5173, 5099, 5221, 5084, 5151, 5157, 5104, 5139, 5187, 5183, 5122, 5070,
    5136, 5142, 5114, 5125, 5129, 5125, 5114, 5229, 5129, 5110, 5102, 5236,
    5081, 5077, 5142, 5164, 5173, 5178, 5123, 5059, 5163, 5132, 5107, 5136,
    5130, 5170, 5174, 5143, 5126, 5123, 5181, 5111, 5149, 5140, 5021, 5208,
    5133, 5146, 5107, 5112, 5130, 5084, 5107, 5159, 5242, 5131, 5145, 5097,
    5155, 5130, 5160, 5105, 5164, 5176, 4995, 5115, 5172, 5192, 5114, 5113,
    5177, 5083, 5173, 5209, 5196, 5117, 5036, 5146, 5185, 5124, 5174, 5070,
    5097, 5054, 5170, 5158, 5108, 5135, 5121, 5169, 5120, 5156, 5153, 5139,
    5074, 5112, 5153, 5123, 5090, 5086, 5084, 5175, 5208, 5063, 5103, 5173,
    5072, 5131, 5160, 5114, 5132, 5178, 5043, 5054, 5067, 5081, 5130, 5164,
    5088};
int l, r, L, R, ans, s, i, Ls, Rs;
inline int prime(int k) {
  if (k < 2) return 0;
  if (k == 2) return 1;
  for (int i = 2; i * i <= k; i++)
    if (k % i == 0) return 0;
  return 1;
}
inline void work(int l, int r) {
  for (int i = l; i <= r; i++)
    if (prime(i))
      if (i % 4 == 1 || i == 2) ans++;
}
int main() {
  scanf("%d%d", &l, &r);
  L = (l == 1) ? 1 : ((l - 2) / 200000 + 2);
  Ls = (L - 1) * 200000;
  R = r / 200000;
  Rs = R * 200000;
  if (L > R)
    work(l, r);
  else
    work(l, Ls), work(Rs + 1, r);
  for (i = L; i <= R; i++) ans += f[i];
  printf("%d", ans);
}

### Prompt

Please provide a cpp coded solution to the problem described below:

On the math lesson a teacher asked each pupil to come up with his own lucky numbers. As a fan of number theory Peter chose prime numbers. Bob was more original. He said that number t is his lucky number, if it can be represented as: 

t = a2 + b2,  where a, b are arbitrary positive integers.

Now, the boys decided to find out how many days of the interval [l, r] (l ≤ r) are suitable for pair programming. They decided that the day i (l ≤ i ≤ r) is suitable for pair programming if and only if the number i is lucky for Peter and lucky for Bob at the same time. Help the boys to find the number of such days.

Input

The first line of the input contains integer numbers l, r (1 ≤ l, r ≤ 3·108).

Output

In the only line print the number of days on the segment [l, r], which are lucky for Peter and Bob at the same time.

Examples

Input

3 5


Output

1


Input

6 66


Output

7

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int f[1501] = {
    0,    8978, 7923, 7622, 7393, 7260, 7254, 7086, 7007, 6966, 6928, 6868,
    6770, 6823, 6730, 6676, 6755, 6656, 6575, 6642, 6591, 6618, 6498, 6547,
    6509, 6519, 6423, 6431, 6445, 6407, 6433, 6399, 6391, 6340, 6381, 6417,
    6320, 6287, 6273, 6341, 6278, 6254, 6257, 6285, 6322, 6223, 6225, 6253,
    6234, 6194, 6174, 6213, 6157, 6188, 6170, 6171, 6181, 6178, 6196, 6182,
    6176, 6094, 6201, 6045, 6166, 6070, 6091, 6093, 6065, 6083, 6073, 6041,
    6120, 6043, 6072, 6025, 6018, 5949, 6009, 6057, 6106, 5984, 6024, 6047,
    5981, 6051, 5960, 6032, 6021, 5994, 5995, 5942, 6003, 5909, 6008, 5992,
    5989, 5938, 5935, 5968, 5984, 5917, 5880, 5961, 5928, 5914, 5905, 5994,
    5906, 5928, 5986, 5836, 5855, 5932, 5876, 5907, 5935, 5909, 5866, 5852,
    5860, 5870, 5962, 5862, 5884, 5858, 5857, 5838, 5837, 5894, 5848, 5840,
    5884, 5891, 5855, 5866, 5830, 5828, 5853, 5797, 5842, 5844, 5828, 5837,
    5834, 5829, 5774, 5872, 5778, 5771, 5899, 5824, 5849, 5842, 5793, 5783,
    5753, 5783, 5789, 5766, 5784, 5792, 5734, 5775, 5781, 5791, 5788, 5778,
    5777, 5760, 5799, 5654, 5722, 5779, 5712, 5786, 5709, 5809, 5721, 5808,
    5682, 5742, 5780, 5801, 5715, 5711, 5823, 5720, 5672, 5725, 5747, 5801,
    5771, 5680, 5779, 5723, 5708, 5744, 5740, 5741, 5662, 5705, 5726, 5711,
    5775, 5667, 5724, 5656, 5711, 5684, 5642, 5688, 5750, 5644, 5663, 5647,
    5684, 5672, 5742, 5620, 5771, 5652, 5658, 5678, 5694, 5673, 5604, 5737,
    5668, 5674, 5632, 5610, 5705, 5624, 5720, 5727, 5645, 5642, 5682, 5663,
    5681, 5666, 5643, 5672, 5609, 5666, 5643, 5663, 5665, 5621, 5666, 5628,
    5605, 5681, 5644, 5611, 5579, 5693, 5609, 5590, 5609, 5650, 5591, 5593,
    5640, 5596, 5584, 5649, 5559, 5601, 5659, 5628, 5555, 5629, 5586, 5635,
    5628, 5579, 5555, 5646, 5627, 5702, 5531, 5566, 5650, 5522, 5578, 5669,
    5615, 5542, 5613, 5556, 5616, 5590, 5563, 5567, 5565, 5502, 5605, 5602,
    5625, 5565, 5605, 5607, 5626, 5573, 5496, 5564, 5537, 5549, 5567, 5636,
    5585, 5508, 5574, 5544, 5589, 5549, 5533, 5612, 5585, 5604, 5617, 5501,
    5549, 5560, 5583, 5540, 5589, 5577, 5532, 5600, 5555, 5548, 5569, 5511,
    5507, 5601, 5587, 5516, 5583, 5512, 5557, 5560, 5580, 5507, 5590, 5526,
    5546, 5548, 5489, 5556, 5505, 5569, 5496, 5485, 5534, 5543, 5565, 5461,
    5557, 5537, 5542, 5549, 5555, 5540, 5459, 5530, 5535, 5521, 5489, 5459,
    5563, 5537, 5526, 5503, 5489, 5536, 5584, 5509, 5562, 5491, 5476, 5509,
    5489, 5545, 5529, 5525, 5466, 5458, 5480, 5500, 5529, 5485, 5497, 5437,
    5512, 5467, 5507, 5525, 5432, 5497, 5540, 5476, 5486, 5499, 5560, 5446,
    5510, 5508, 5554, 5452, 5461, 5494, 5494, 5553, 5392, 5449, 5506, 5468,
    5633, 5413, 5491, 5488, 5443, 5492, 5434, 5504, 5537, 5477, 5395, 5502,
    5458, 5487, 5402, 5455, 5509, 5469, 5483, 5493, 5518, 5454, 5494, 5398,
    5516, 5464, 5487, 5475, 5446, 5408, 5450, 5412, 5515, 5466, 5419, 5407,
    5455, 5513, 5342, 5466, 5451, 5489, 5459, 5466, 5507, 5424, 5429, 5453,
    5430, 5374, 5503, 5480, 5382, 5462, 5448, 5536, 5396, 5443, 5505, 5400,
    5484, 5453, 5396, 5422, 5480, 5448, 5422, 5399, 5470, 5417, 5459, 5413,
    5411, 5471, 5384, 5407, 5452, 5401, 5434, 5412, 5444, 5435, 5384, 5413,
    5436, 5433, 5420, 5427, 5381, 5431, 5438, 5415, 5518, 5399, 5412, 5434,
    5359, 5398, 5413, 5380, 5471, 5429, 5468, 5404, 5394, 5412, 5408, 5426,
    5415, 5389, 5375, 5436, 5373, 5437, 5358, 5371, 5493, 5451, 5364, 5461,
    5317, 5420, 5426, 5447, 5446, 5404, 5437, 5378, 5424, 5430, 5464, 5345,
    5333, 5385, 5438, 5416, 5403, 5388, 5372, 5466, 5445, 5465, 5397, 5319,
    5453, 5342, 5430, 5352, 5340, 5346, 5324, 5381, 5382, 5327, 5476, 5339,
    5399, 5387, 5400, 5378, 5364, 5389, 5410, 5310, 5327, 5391, 5348, 5419,
    5411, 5347, 5367, 5434, 5373, 5408, 5296, 5370, 5408, 5389, 5401, 5363,
    5364, 5328, 5336, 5355, 5378, 5399, 5413, 5325, 5423, 5307, 5355, 5348,
    5370, 5358, 5397, 5406, 5413, 5396, 5371, 5366, 5388, 5348, 5412, 5310,
    5398, 5363, 5351, 5367, 5320, 5385, 5365, 5372, 5325, 5385, 5328, 5378,
    5404, 5344, 5374, 5376, 5359, 5374, 5335, 5361, 5443, 5399, 5362, 5329,
    5397, 5418, 5275, 5284, 5346, 5284, 5416, 5376, 5336, 5419, 5371, 5360,
    5330, 5349, 5357, 5377, 5328, 5303, 5411, 5287, 5362, 5294, 5355, 5332,
    5390, 5361, 5347, 5354, 5355, 5308, 5294, 5342, 5291, 5304, 5321, 5404,
    5353, 5289, 5272, 5364, 5391, 5372, 5206, 5319, 5271, 5350, 5296, 5389,
    5358, 5329, 5419, 5364, 5366, 5376, 5271, 5312, 5275, 5305, 5260, 5406,
    5312, 5369, 5321, 5341, 5377, 5250, 5328, 5310, 5334, 5396, 5306, 5344,
    5337, 5343, 5382, 5297, 5309, 5308, 5331, 5327, 5308, 5300, 5366, 5330,
    5328, 5320, 5324, 5340, 5313, 5334, 5353, 5233, 5326, 5301, 5298, 5328,
    5291, 5281, 5310, 5313, 5312, 5329, 5299, 5298, 5282, 5297, 5308, 5232,
    5300, 5313, 5279, 5331, 5332, 5245, 5197, 5289, 5333, 5274, 5314, 5278,
    5348, 5358, 5319, 5322, 5282, 5286, 5251, 5336, 5274, 5263, 5373, 5254,
    5292, 5395, 5302, 5309, 5336, 5300, 5207, 5329, 5349, 5237, 5293, 5268,
    5320, 5183, 5250, 5318, 5303, 5241, 5363, 5269, 5307, 5283, 5286, 5326,
    5237, 5338, 5366, 5214, 5299, 5274, 5246, 5268, 5335, 5296, 5312, 5257,
    5276, 5320, 5320, 5349, 5328, 5223, 5324, 5268, 5268, 5269, 5226, 5276,
    5289, 5234, 5329, 5200, 5329, 5301, 5261, 5254, 5292, 5246, 5290, 5257,
    5313, 5260, 5280, 5257, 5302, 5279, 5374, 5313, 5318, 5235, 5229, 5339,
    5272, 5262, 5190, 5283, 5301, 5308, 5262, 5269, 5232, 5317, 5282, 5262,
    5276, 5253, 5321, 5302, 5301, 5230, 5280, 5271, 5265, 5268, 5233, 5269,
    5280, 5287, 5308, 5218, 5266, 5227, 5306, 5229, 5294, 5275, 5287, 5295,
    5227, 5261, 5320, 5307, 5225, 5252, 5279, 5285, 5290, 5286, 5255, 5349,
    5289, 5255, 5229, 5268, 5234, 5182, 5232, 5317, 5217, 5284, 5292, 5287,
    5167, 5201, 5275, 5198, 5283, 5210, 5264, 5272, 5229, 5254, 5309, 5277,
    5300, 5250, 5294, 5272, 5187, 5220, 5278, 5290, 5201, 5243, 5247, 5287,
    5297, 5253, 5239, 5199, 5253, 5334, 5181, 5241, 5290, 5177, 5331, 5265,
    5252, 5245, 5302, 5229, 5237, 5159, 5160, 5156, 5265, 5218, 5236, 5195,
    5196, 5213, 5245, 5262, 5292, 5281, 5284, 5161, 5264, 5275, 5242, 5243,
    5240, 5217, 5258, 5289, 5258, 5181, 5247, 5271, 5226, 5217, 5209, 5265,
    5176, 5232, 5178, 5204, 5200, 5194, 5258, 5193, 5245, 5265, 5289, 5147,
    5182, 5335, 5206, 5172, 5295, 5350, 5163, 5260, 5200, 5195, 5329, 5241,
    5176, 5233, 5289, 5280, 5229, 5212, 5172, 5214, 5240, 5286, 5195, 5247,
    5255, 5190, 5178, 5282, 5230, 5257, 5174, 5214, 5171, 5254, 5188, 5237,
    5211, 5245, 5190, 5262, 5160, 5261, 5264, 5205, 5162, 5187, 5175, 5204,
    5254, 5179, 5178, 5225, 5266, 5314, 5185, 5260, 5239, 5170, 5172, 5197,
    5296, 5265, 5205, 5217, 5242, 5167, 5267, 5235, 5234, 5265, 5209, 5223,
    5215, 5185, 5225, 5245, 5158, 5177, 5255, 5260, 5269, 5224, 5215, 5220,
    5245, 5262, 5251, 5192, 5192, 5197, 5196, 5244, 5121, 5227, 5160, 5271,
    5174, 5143, 5217, 5161, 5188, 5258, 5200, 5163, 5190, 5255, 5251, 5154,
    5163, 5171, 5220, 5247, 5158, 5261, 5159, 5255, 5160, 5274, 5233, 5192,
    5213, 5153, 5304, 5196, 5105, 5192, 5282, 5195, 5160, 5329, 5205, 5107,
    5169, 5210, 5222, 5205, 5174, 5192, 5285, 5234, 5246, 5211, 5110, 5068,
    5178, 5203, 5142, 5136, 5272, 5177, 5203, 5142, 5198, 5155, 5205, 5228,
    5161, 5223, 5235, 5109, 5188, 5189, 5179, 5217, 5247, 5173, 5194, 5191,
    5249, 5194, 5134, 5126, 5220, 5204, 5141, 5189, 5131, 5179, 5209, 5231,
    5158, 5235, 5254, 5133, 5170, 5245, 5176, 5175, 5244, 5205, 5173, 5181,
    5241, 5145, 5185, 5246, 5197, 5134, 5264, 5167, 5135, 5183, 5181, 5165,
    5144, 5196, 5252, 5249, 5114, 5202, 5225, 5200, 5196, 5118, 5199, 5116,
    5117, 5154, 5125, 5200, 5105, 5180, 5194, 5201, 5203, 5160, 5151, 5212,
    5198, 5268, 5188, 5206, 5202, 5156, 5148, 5133, 5140, 5185, 5146, 5190,
    5177, 5109, 5190, 5111, 5173, 5151, 5254, 5156, 5189, 5193, 5182, 5165,
    5109, 5161, 5166, 5171, 5164, 5117, 5239, 5262, 5103, 5151, 5145, 5144,
    5124, 5229, 5085, 5177, 5108, 5157, 5181, 5228, 5250, 5112, 5144, 5167,
    5189, 5189, 5192, 5226, 5145, 5179, 5148, 5194, 5158, 5186, 5147, 5123,
    5128, 5274, 5190, 5211, 5134, 5091, 5207, 5144, 5175, 5211, 5213, 5162,
    5145, 5198, 5190, 5071, 5125, 5182, 5174, 5189, 5182, 5224, 5200, 5147,
    5175, 5112, 5136, 5207, 5196, 5242, 5118, 5208, 5229, 5148, 5096, 5182,
    5112, 5189, 5195, 5118, 5128, 5229, 5139, 5239, 5174, 5190, 5186, 5153,
    5095, 5098, 5125, 5156, 5159, 5150, 5185, 5103, 5170, 5162, 5113, 5238,
    5128, 5222, 5141, 5188, 5070, 5098, 5126, 5111, 5217, 5181, 5132, 5131,
    5089, 5137, 5140, 5224, 5116, 5120, 5186, 5153, 5081, 5117, 5101, 5172,
    5202, 5147, 5184, 5190, 5152, 5143, 5188, 5146, 5078, 5179, 5167, 5127,
    5173, 5099, 5221, 5084, 5151, 5157, 5104, 5139, 5187, 5183, 5122, 5070,
    5136, 5142, 5114, 5125, 5129, 5125, 5114, 5229, 5129, 5110, 5102, 5236,
    5081, 5077, 5142, 5164, 5173, 5178, 5123, 5059, 5163, 5132, 5107, 5136,
    5130, 5170, 5174, 5143, 5126, 5123, 5181, 5111, 5149, 5140, 5021, 5208,
    5133, 5146, 5107, 5112, 5130, 5084, 5107, 5159, 5242, 5131, 5145, 5097,
    5155, 5130, 5160, 5105, 5164, 5176, 4995, 5115, 5172, 5192, 5114, 5113,
    5177, 5083, 5173, 5209, 5196, 5117, 5036, 5146, 5185, 5124, 5174, 5070,
    5097, 5054, 5170, 5158, 5108, 5135, 5121, 5169, 5120, 5156, 5153, 5139,
    5074, 5112, 5153, 5123, 5090, 5086, 5084, 5175, 5208, 5063, 5103, 5173,
    5072, 5131, 5160, 5114, 5132, 5178, 5043, 5054, 5067, 5081, 5130, 5164,
    5088};
int l, r, L, R, ans, s, i, Ls, Rs;
inline int prime(int k) {
  if (k < 2) return 0;
  if (k == 2) return 1;
  for (int i = 2; i * i <= k; i++)
    if (k % i == 0) return 0;
  return 1;
}
inline void work(int l, int r) {
  for (int i = l; i <= r; i++)
    if (prime(i))
      if (i % 4 == 1 || i == 2) ans++;
}
int main() {
  scanf("%d%d", &l, &r);
  L = (l == 1) ? 1 : ((l - 2) / 200000 + 2);
  Ls = (L - 1) * 200000;
  R = r / 200000;
  Rs = R * 200000;
  if (L > R)
    work(l, r);
  else
    work(l, Ls), work(Rs + 1, r);
  for (i = L; i <= R; i++) ans += f[i];
  printf("%d", ans);
}

```