[Question]
  [
When you edit a post on SE, any further edits within a 5-minute grace period are merged into it. Given a list of times you edit a post, count the edits not in a grace period.
Say you edit at minutes `[0,3,4,7,9,10,11,12]`. This results in 3 edits at times `[0,7,12]`, with the rest happening in their grace periods.
```
0:  [3,4]
7:  [9,10,11]
12: []
```
* The first edit is at minute 0. The edits at minutes 3 and 4 are within its 5-minute grace period, and so don't count.
* The second edit is at minute 7. The edits at minutes 9, 10, 11 are within its grace period.
* The third edit at minute 12 is just past the edge of the 5-minute grace period starting at minute 7.
So, the output is 3.
The list of times in minutes will be an list of increasing integers. The first number will always be 0 for the initial posting, which we count as an edit.
**Test cases:**
```
[0]
[0,3,5,7]
[0,3,4,7,9,10,11,12]
[0,30,120]
[0,4,8,12,16]
[0,4,8,12,16,20]
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
[0,5,10,15,20]
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
[0,1,4,5,9,11,12,14,16,18,23,24,26,28,29,30]
```
Outputs:
```
1
2
3
3
3
3
4
5
5
6
```
For ease of copying, here are the inputs, outputs, and input/output pairs:
```
[[0], [0, 3, 5, 7], [0, 3, 4, 7, 9, 10, 11, 12], [0, 30, 120], [0, 4, 8, 12, 16], [0, 4, 8, 12, 16, 20], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [0, 5, 10, 15, 20], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], [0, 1, 4, 5, 9, 11, 12, 14, 16, 18, 23, 24, 26, 28, 29, 30]]
[1, 2, 3, 3, 3, 3, 4, 5, 5, 6]
[([0], 1), ([0, 3, 5, 7], 2), ([0, 3, 4, 7, 9, 10, 11, 12], 3), ([0, 30, 120], 3), ([0, 4, 8, 12, 16], 3), ([0, 4, 8, 12, 16, 20], 3), ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], 4), ([0, 5, 10, 15, 20], 5), ([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], 5), ([0, 1, 4, 5, 9, 11, 12, 14, 16, 18, 23, 24, 26, 28, 29, 30], 6)]
```
**Leaderboard:**
```
var QUESTION_ID=141949,OVERRIDE_USER=20260;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/141949/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
# JavaScript, 36 bytes
```
f=$=>$>f&&1+f($.filter(b=>b-$[0]>4))
```
[Try it online!](https://tio.run/##nY/NCsIwEITvPkUPRRKcFjdN@oM0L1IKRm2kpTai4uvXtOAf3jztzjDfsNuZu7nuL@35Fg3u0IyjLcNSh9oul7SyLIxt29@aC9uVeheF1brWkvNx74ar65u4d0dWLYLA@5gHEihkbyGRoQCtQQQSL99r8UIkci9B6Y@Bd4gg5jqF1FfmH6WgBCRBagIoA3m4eGJqjqn/i77IiSqeYTnHcogEQkL4Y/1e@N/qRR2fzJmZUltmOI871w7bYMs34wM)
### How it works
In each recursive call we delete all elements from the array which are more than 4 minutes distant from the first element.  
There is a little trick with variable name `$`. The check `$>f` firstly converts the array to a string and then compare it to the string representation of the function `f` and then compares them lexicographically. The first character of stringified array is a digit and therefore only one-char variable name whose ascii index is smaller than indices of all digits is `$`. Replacing `$` with any other variable name will always return `false`.
[Answer]
# Mathematica, ~~46~~ ~~40~~ ~~37~~ 33 bytes
```
(i=1;j=0;#-j<5||(i++;j=#)&/@#;i)&
```
### Explanation
```
i=1;j=0
```
Set `i` to `1` and `j` to `0`.
```
... /@#
```
Map onto all elements of the input...
```
#-j<5||(i++;j=#)&
```
If `(element) - j < 5` is false, then increment `i` and set `j` to the element (short-circuit evaluation).
```
;i
```
Output `i`.
[Answer]
# [Husk](https://github.com/barbuz/Husk), 8 bytes
```
Γ(→₀f>+4
```
[Try it online!](https://tio.run/##nY@xDcIwEEV7pqAM4he@8zm2GxaJ0iIkRENEDykYgOzCAAzAEF7EXJwgoKX7/@79r7vdqdvn5aHqUn85rh73/ByqdL2l/rzdrCXn3Jh20RhYOPhZCTwiyIAIxNNQDU@kIKgG1b8O85rApcKh1prwVQSyIAG5kSYP0mQsGVcY92fFJzZG4puUwgSwBQtYD1Qd9ZP2BQ "Husk – Try It Online")
## Explanation
```
Γ(→₀f>+4  Implicit input, a list of numbers.
Γ(        Deconstruct into head n and tail x (if empty, return 0).
    f>+4  Keep those elements of x that are greater than n+4.
   ₀      Call main function recursively on the result.
  →       Increment.
```
[Answer]
# [Python 2](https://docs.python.org/2/), 58 bytes
```
a=input()
x=[0]
for k in a:x+=[k]*(k-x[-1]>4)
print len(x)
```
[Try it online!](https://tio.run/##BcFBCoAgEADAu6/wqLWBW0EU2EcWDx2KxFhFDOz1NpO@ckceWzus5/QWpUW1ZJy4YpZBepbHVntLwXUqDJUGdPusRcqei3xOVlW3RgYmmGGBFdAAIuDofg)
* Saved 2 bytes thanks to @Mr. Xcoder.
## 49 bytes
```
f=lambda a:a>[]and-~f([x for x in a if x-a[0]>4])
```
Using the recursive method shown in @ThePirateBay's [solution](https://codegolf.stackexchange.com/a/141959/6710).
* Saved a byte thanks to @Mr. Xcoder.
* Saved 2 bytes thanks to @Halvard Hummel.
[Try it online!](https://tio.run/##DcqxCoAgFEbhV/nHghtoBVGQLyION0ISSkUcbOnVzeEMB7745iv4sVa73/wcJ4M3VtqwP4fPdrrAhoQC58FwFmVgLYyaTV9jcj6jGUGYCDNhIawE2V7K1tjQDw)
[Answer]
## Husk, 6 bytes
```
Lüo<+5
```
[Try it online!](https://tio.run/##nY@xDQIxEARzqiAEsYH37HvbEiXQwetzJISQeFEAFEVEBJ3QiLn3PwJSst272dXd9tTvyny/6J@X83F5v5bN43ZYr7SU0rpu1jp4KOKkAiIy6ECCMg7NyEgGJNNg8@swrQmpFYrGatJXEejBAOpAM4KWzDWjldE/Kz6xIZLfZKhMgnhIgNiBprN90r0A "Husk – Try It Online")
```
  o<+5        a function that takes two arguments and checks if
              the second is less than the the first plus 5
 ü            remove equal elements from the input list using the above
              function as the equality test
L             return the length of the remaining list
```
[Answer]
# MATLAB, 34 bytes
```
@(x)nnz(uniquetol(x+1,4/max(x+1)))
```
Anonymous function that inputs an array and outputs a number.
This uses the [`uniquetol`](https://es.mathworks.com/help/matlab/ref/uniquetol.html) function, specifically its form `y = uniquetol(x, t)`, which gives `y` containing unique elements of `x` with tolerance `t`. In doing so, the function [seems](https://stackoverflow.com/questions/46101271/what-does-uniquetol-do-exactly) to follow a "lazy" approach: sort `x`, pick its first entry, and keep skipping entries for as long as they are within tolerance of the latest picked entry. That is exactly what is needed here.
The `uniquetol` function automatically scales the specified tolerance by the maximum absolute value in `a`. This is why we need the division here. `x+1` is used instead of `x` to avoid division by 0.
Verification of test cases:
```
>> f = @(x)nnz(uniquetol(x+1,4/max(x+1)));
>> inputs = {...
       [0] ...
       [0,3,5,7] ...
       [0,3,4,7,9,10,11,12] ...
       [0,30,120] ...
       [0,4,8,12,16] ...
       [0,4,8,12,16,20] ...
       [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19] ...
       [0,5,10,15,20] ...
       [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] ...
       [0,1,4,5,9,11,12,14,16,18,23,24,26,28,29,30] ...
   };
>> outputs = cellfun(f, inputs)
outputs =
     1     2     3     3     3     3     4     5     5     6
```
[Answer]
# [J](http://jsoftware.com/), 20 bytes
```
[:#(,}.~5>(-{.))/@|.
```
[Try it online!](https://tio.run/##nY9BCsJADEX3PcUHQVqwY5OZtDMVi/dwKRZx4wHUXn3MTKuISxeBn@T9T3KNccS@x7FflZunmWQo67upqu3hYYrifLrcMK4HNNhpWQi6RTlVAdSACMTzUBueSQefptT@dMuawDlC0GqM/w4iC3IgSTR1IHWG7JHMyL8RH1uyhDfpMuPBFuzAeqDqoJ/E@AI "J – Try It Online")
## Explanation
```
[:#(,}.~5>(-{.))/@|.  Input: array A
                  |.  Reverse
                /@    Reduce from right-to-left
            {.          Head of RHS
           -            Subtract with LHS
        5>              Less than 5
     }.~                Drop that many from
    ,                   Join
[:#                   Length
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~20~~ ~~19~~ ~~18~~ ~~15~~ ~~14~~ 11 bytes
```
v®y‹iy4+©\¼
```
**Explanation:**
```
v          # loop on input
 ®          # push register_c, start at -1
  y‹i         # if current item greater than last item
   y4+         # push new max on stack
    ©\          # push new max on register_c, and pop it from stack
     ¼           # increment counter_variable
                  # implicit print of counter_variable
```
[Try it online!](https://tio.run/##MzBNTDJM/f@/7NC6ykcNOzMrTbQPrYw5tOf//2gDHUMdEx1THUsdQ0MdQyMdQxMdQzMdQwsdI2MdIxMdIzMdIyDbUsfYIBYA "05AB1E – Try It Online")
**Edit**
* -3 bytes thanks to [Riley](https://codegolf.stackexchange.com/users/57100/riley) and the usage of counter\_variable
* no need for counter\_variable after all
* -3 bytes again thanks to [Riley](https://codegolf.stackexchange.com/users/57100/riley) and the usage of register\_c
[Answer]
# [Haskell](https://www.haskell.org/), ~~31~~ 30 bytes
```
f(x:y)=f[z|z<-y,z-4>x]+1
f x=0
```
[Try it online!](https://tio.run/##nVDLasJAFN3PVxxCFwleIXcyURMaoYUWpIILlyI4wYRIrWmN4gP/PR1TbZNCW@hdDJc5z5lMF8/JclmWqb0PD06UTo6n4237QMe26u@nLRYp9pFbFlm@Xc7vE4Qh7Ic3aMI4y3fQDqI@NNqXYzCC7QiN2VUwQ4wTdBTFqCbC63Yz3qyHK1ijJ0ugOSfkmyxZ7xZFUqfewHq8GwxDWGi1YBeXaLNb@EhCnNTB2BHiRS9WxmSeVyEpJu603os/r8kjn7oNUNZBRV0KiF1iJpYNnlfjGVy6P6GKegYm7vxJoJ9NmGRVx6eOqdSrlSL2iBWxfzbgLrExCxo26svGr2T@9yD/30G/Op1dgqtYVbIeSY@kImkea/bA/F1D3xGifAc "Haskell – Try It Online")
Saved 1 byte thanks to [Zgarb](https://codegolf.stackexchange.com/users/32014/zgarb)
[Answer]
# [Perl 5](https://www.perl.org/), 54 bytes
52 bytes of code +2 for `-ap`
```
{$_++;$p=shift@F;1while$F[0]<$p+5&&shift@F;@F&&redo}
```
[Try it online!](https://tio.run/##Ncm9CsIwGAXQV7lDyBIquW3TH6rQKZtPICKCkQaKCW3BQXx1P11cz8lhmZ3IS12MGVQ@rFO8b6Mf@JziHJQ/2fNeZeO0/s/otV7CLb1FLIgSFWo4NGjRoQd/SLAEK7AGHdiALdiB/SflLabHKsXR7SytFNf8BQ "Perl 5 – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 14 bytes
```
æʒ¬s¥4›Ps_*}θg
```
[Try it online!](https://tio.run/##MzBNTDJM/f//8LJTkw6tKT601ORRw66A4nit2nM70v//jzbQMdQx0THVsdQxNNQxNNIxNNExNNMxtNAxMtYxMtExMtMxArItdYwNYgE "05AB1E – Try It Online")
[Answer]
# [Ly](https://github.com/LyricLy/Ly), 29 bytes
```
&nr5+sp[[lL[pp2$]p5+sp>`<]]>`
```
[Try it online!](https://tio.run/##FcixCYAwFEXR/s4hNiL4ookK4gRuEAIWlkGCVk7/1fKc/JjV5@Wbu8SYt1iKq1L5ue5LSutu1iEcPQOewMjEjL4UcqhHA/IooBFNaMZ11h4v "Ly – Try It Online")
It took a long time to get here.
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~32~~ 26 bytes
```
.+
$*11
(1+)(¶1{1,4}\1)*\b
```
[Try it online!](https://tio.run/##K0otycxL/P9fT5tLRcvQkEvDUFtT49A2w2pDHZPaGENNrZik//8NuIy5TLjMuSy5DA24gIoMjQA "Retina – Try It Online") Explanation:
```
.+
$*11
```
Convert to unary, but add 1, because 0 is a tricky concept in Retina.
```
(1+)(¶1{1,4}\1)*\b
```
Count the number of edits, but include all the grace edits in each match.
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~13~~ 12 bytes
```
`ttX<4+>)t}@
```
[Try it online!](https://tio.run/##y00syfn/P6GkJMLGRNtOs6TW4f//aAMdYx0THXMdSx1DAx1DQx1Do1gA) Or [verify all test cases](https://tio.run/##nY@xDsIwDER3/gRxQ85xmkRCiIFPYKhURSo7bFn59uCmRcDKdme/O9mPW723uc21jkc9nPb1eW5lvFzb5MpucvAIiJtSRGTQgQRlHZqRlVQk0@Dw67CtCekVAYPVpK8i0IMKhoVmBC2ZeyZ0JvxZ8YktkfwmtTMJ4iEKsQNNZ/ukvAA).
### Explanation
```
`        % Do..while
  t      %   Duplicate. Takes input (implicitly) the first time
  tX<    %   Duplicate and get minimum, i.e the first entry
  4+     %   Add 4
  >      %   Greater than? Element-wise
  )      %   Keep entries that fulfill that
  t      %   Duplicate. This is used as loop condition
}        % Finally (execute at the end of the loop)
  @      %   Push number of iterations. This is the output
         % End (implicit). A new iteration is run if top of the stack is truthy
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 14 bytes
```
L&lbhyfg-Thb5b
```
This is a recursive function. Call it with `y[0 1 2 3 4 5 6 7 8)`, where `[...)` is your list.
Alternatively, **[Try it here!](https://pyth.herokuapp.com/?code=L%26lbhyfg-Thb5b%3ByQ&input=%5B0%2C3%2C4%2C7%2C9%2C10%2C11%2C12%5D&debug=0)** or **[Verify all the test cases.](https://pyth.herokuapp.com/?code=L%26lbhyfg-Thb5b%3ByQ&input=%5B0%2C3%2C4%2C7%2C9%2C10%2C11%2C12%5D&test_suite=1&test_suite_input=%5B0%5D%0A%5B0%2C3%2C5%2C7%5D%0A%5B0%2C3%2C4%2C7%2C9%2C10%2C11%2C12%5D%0A%5B0%2C30%2C120%5D%0A%5B0%2C4%2C8%2C12%2C16%5D%0A%5B0%2C4%2C8%2C12%2C16%2C20%5D%0A%5B0%2C1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%5D%0A%5B0%2C5%2C10%2C15%2C20%5D%0A%5B0%2C1%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%5D%0A%5B0%2C1%2C4%2C5%2C9%2C11%2C12%2C14%2C16%2C18%2C23%2C24%2C26%2C28%2C29%2C30%5D&debug=0)**
---
# Explanation
This is roughly equivalent to the Python solution. A translation would give the following results:
```
def y(b):
 return (len(b) and y(filter(lambda T:T>=b[0]+5,b)) + 1)
```
### Code Breakdown
```
L&lbhyfg-Thb5b   - Function called y that accepts a list parameter b.
L                - Define the function.
  lb             - The length of b...
 &               - ... Logical AND ...
    h            - Increment by 1.
     y           - The result given by calling the function recursively on the following:
      f      b     - b filtered...
        -Thb       - ... For the elements whose difference compared to the first element...
       g    5      - ... Is greater than or equal to 5.
```
[Answer]
# Java 8, ~~78~~ ~~61~~ ~~60~~ ~~59~~ 56 bytes
***Port of @JungHwanMin's answer***
```
a->{int i=0;for(int l:a)if(l-a[i]>4)a[++i]=l;return-~i;}
```
[Try it online!](https://tio.run/##TY6xboMwEIZ3nsIjNIeFCY2aUhgrdeiUETG4xKCjxrbMkSqK6KtTUqGqN326@3X/18uLjK1Tpj9/Ljg464n1645PhJq3k2kIreEPeRC46UNjwxotx5G9SzTsFrBtRpK03l63/MubIdUpX9XANiyZYsUi4/KGhhgWSd5aH95ZP8sI21DHssK6zCJZ7XZYFzr3iiZv4m/M52Xtv/dsDlvdxeKZDatJeCKPpqtqJn03Rv/ETteR1MDtRNytEQoVl87pa2jUF/uzvCUgIINHOIIQIFIQGYgDiCdI95BmkB4gXfkI@2SOovz3@xzMyw8 "Java (OpenJDK 8) – Try It Online")
[Answer]
# C# .NET, 63 bytes
```
a=>{int e=0;foreach(int l in a)if(l-a[e]>4)a[++e]=l;return-~e;}
```
**Explanation:**
[Try it here.](https://tio.run/##tZExT4UwFIV3fsUdIe9iaCkPSIXFxMk3OTiQNzS1T5tgSWjRGIJ/HQvR6AjDm9qbnPOde1ppY9n1ah6sNi/w@GmdeuOBbIW1cBoDAOuE0xLuByNvtXHNGcEfNUioZlHVox9AVQm/eIqQr@Eyt14CItKXsI1Fo841i0RzOKhz1fJeuaE38Zfi08yDv4D3Tj/DSWgTRksswF1nbNeqm6deO/WgjQplaNQHrEuMyRRFfIsOU8ww36FmmGOJJEFCkNDtRm@g27diWHg9kuN@B@6IIUjXShkefa3iXzEkKRKGJFuIJEfi6eVmbrZysiuusg@9YMtfGls5BdIUKUPqH8zfS/9DP8ApmOZv)
```
a=>{                   // Method with integer-array parameter and integer return-type
  int e=0;             //  Amount of edits (starting at 0)
  foreach(int l in a)  //  Loop over the input-array
    if(l-a[e]>4)       //   If the current value minus the current edit is larger than 4:
      a[++e]=l;        //    Raise the edit-count by 1 first,
                       //    and set the current value to this next current edit
                       //  End of loop (implicit / single-line body)
  return-~e;           //  Return the amount of edits + 1
}                      // End of method
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 20 bytes
```
Fxg{Ix>i+4{++oi:x}}o
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724ILNgwYKlpSVpuhZb3CrSqz0r7DK1Taq1tfMzrSpqa_MhUlAVN3WiDXQMdUx0THUsdQwNdQyNdAxNdAzNdAwtdIyMdYxMdIzMdIyAbEsdY4NYqCYA)
#### Explanation
```
Fxg{Ix>i+4{++oi:x}}o  # Implicit input on the command line
Fxg{              }   # for x in input:
    Ix>i+4{      }    #  if x > i+4:
           ++o        #   increment o (defaults to 1)
              i:x     #   i = x
                   o  # print o
```
[Answer]
# Pyth, 25 bytes
```
J1K5FN.+Q=-KNIg0K=hJ=K5;J
```
Try it here: <http://pyth.herokuapp.com>
[Answer]
# [Proton](https://github.com/alexander-liao/proton), 40 bytes
Heavily inspired by the [Python solution](https://codegolf.stackexchange.com/a/141955/59487).
```
f=a=>len(a)and-~f(filter(x=>x>a[0]+4,a))
```
[Try it online!](https://tio.run/##Dcs7CoAwEAXA62zwCT6NvyK5iFgsaECQKCGFlVePtgNzpytfsZTg1Plzj6JG41a/QcJx5j3J4/zjdWnWykKNKXc6YpYgSwOiRQeLHgNGTJjBHwm2YAdasAcHcAQncF7//QE "Proton – Try It Online")
[Answer]
# Kotlin, 52 bytes
*Posting as a function, if this is not acceptable I will change it to a method*
## Submission
```
{var x=it[0]
var o=1
it.map{if(it>x+4){o++
x=it}}
o}
```
## Beautified
```
{
    // Last counted edit
    var x=it[0]
    // Current edit total
    var o = 1
    // For each edit
    it.map{
        // If it was 5 or more minutes ago
        if (it>x+4) {
            // Increase edit count
            o++
            // Make it the last counted edit
            x=it
        }
    }
    // Return the edit count
    o
}
```
## Test
```
var r:(IntArray)->Int=
{var x=it[0]
var o=1
it.map{if(it>x+4){o++
x=it}}
o}
fun main(args: Array<String>) {
    println(r(intArrayOf(0)))
    println(r(intArrayOf(0,3,5,7)))
    println(r(intArrayOf(0,3,4,7,9,10,11,12)))
    println(r(intArrayOf(0,30,120)))
    println(r(intArrayOf(0,4,8,12,16)))
    println(r(intArrayOf(0,4,8,12,16,20)))
    println(r(intArrayOf(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19)))
    println(r(intArrayOf(0,5,10,15,20)))
    println(r(intArrayOf(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)))
    println(r(intArrayOf(0,1,4,5,9,11,12,14,16,18,23,24,26,28,29,30)))
}
```
[TryItOnline](https://tio.run/##rZAxT8MwFIR3/wqPtnKgPMdukopEYmRiYEQMXlJZtE5lDCqK8tuDHYHERDrg6Wzf@@70Xsd4dH75sIGHvXjw8T4E@ylv@iS7Zcrvl87F5/KFZT12xFy8Pdnz5AbhYn8ptJzGomDZNc9snJfh3fOTdV7YcHjb8xV49xSD84de8onxdM7pFo9eBOG@Ix8HUUop//hFBYN606NRowWVIAKpLXuyqa1cjSa5QLtrfdhEEtRa1WCX6ja/CoMqkAaZzKEalJjtBs2s0@bfY68BZlj7w9DrdANVQWmotIik27TljJmXLw)
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 74 bytes
```
for($x,$y=$args[0];$y;$x,$y=$y){if($l-le$x-5){$i++;$l=$x}}$i+1+($l-le$x-5)
```
Iterative solution. Lengthy because of fenceposting on the `for` loop requiring an additional check on the end. *Golfing suggestions welcome.*
We take input `$args[0]` as a literal array, peel off the first element into `$x` and the remaining into `$y`. Then, so long as there are elements still in `$y`, we loop.
Each iteration, we check whether the current timestamp `$x` is `5` or more away from the `$l`ast edit timestamp. If so, we increment our counter `$i++` and set our timestamp to be current. Then, on the iteration of the loop, we peel off the next element into `$x` and leave the remaining in `$y`.
Once we're out of the loop, we output `$i`, plus `1` for the initial edit, plus whether the final timestamp is more than five away from the last edit (with the Boolean value implicitly cast to integer). That result is left on the pipeline and output is implicit.
[Try it online!](https://tio.run/##Tcm9CoMwGIXhm/kGQ46QE40/BKH3UTp0iK0QsMRBRbz21KFDt5fn/cxrSMs7xJjzOKdCNsg@yDO9lrt5eNn9T3Z1TGMhsYxBttKpQyatvcRBtvO8mvpv5pxvhQFhUaGGQ4MWHXrwQoIWrMAadGADtmAH9rBGfQE "PowerShell – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 52 bytes
```
function(l){while(sum(l|1)){l=l[l-l[1]>=5]
F=F+1}
F}
```
[Try it online!](https://tio.run/##Dci9CoMwGAXQPU9RnBJ6hV41/kDTMS8hDkUaKnymUCsdrM@eesbzTuF0zVNY4/iZXlGL2b7PSR56WWctPxqziZNecuk53JwdlHf@zF35PQW9jPeocciQGaMuIAqUqGBRo0GLDjySYAGWYAVasAYbsAW79Ac "R – Try It Online")
Simple anonymous function that iteratively removes elements from the list that are less than 5 away from the first element until the list is empty, then returns the counter.
[Answer]
## Clojure, 53 bytes
```
#(count(set(reductions(fn[r v](if(<(- v r)5)r v))%)))
```
This keeps track of the "edit starting times", and then returns their distinct count.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 11 bytes
```
+4Ḣ<x@µÐĿL’
```
[Try it online!](https://tio.run/##y0rNyan8/1/b5OGORTYVDoe2Hp5wZL/Po4aZ/w@3P2pa8/9/dLRBrI5CtIGOgrGOgqmOgjmCZwLk6ShY6igYAvmGhkBsBJMECRjBNALVWYD4QGyGRUhHAa4SaIYRzGigXWZgCyzQ7ABioApDoBJDU4h@Q6AqQ5B5llBzTKHqTalpNqpZEFMskTSaQDUAFRsBDTEC8o1AngPxLUFhEhsLAA)
## Explanation
```
+4Ḣ<x@µÐĿL’  Input: array A
      µÐĿ    Repeat until the results converge
+4             Add 4
  Ḣ            Head
   <           Greater than
    x@         Copy only the true values
         L   Length
          ’  Decrement
```
## 12 bytes
```
;I4<1;x@;ð/L
```
[Try it online!](https://tio.run/##y0rNyan8/9/a08TG0LrCwfrwBn2f/4fbHzWt@f8/OtogVkch2kBHwVhHwVRHwRzBMwHydBQsdRQMgXxDQyA2gkmCBIxgGoHqLEB8IDbDIqSjAFcJNMMIZjTQLjOwBRZodgAxUIUhUImhKUS/IVCVIcg8S6g5plD1ptQ0G9UsiCmWSBpNoBqAio2AhhgB@UYgz4H4lqAwiY0FAA "Jelly – Try It Online")
## Explanation
```
;I4<1;x@;ð/L  Input: array A
         ð/   Reduce A from left-to-right using
;               Concatenate
 I              Increment
  4<            Greater than 4
    1;          Prepend 1
      x@        Times each of
        ;       Concatenate
           L  Length
```
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~62~~ 61 bytes
*-1 byte thanks to [@ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)*
```
f(v,t,c)int*v;{for(t=c=0;*++v;)*v-t>4&&(t=*v)&++c;return-~c;}
```
[Try it online!](https://tio.run/##rZJhT4MwEIa/8ytOjEuBLqE45kjFP4J8MB2YRu0WxkgWgn8dr7RsTOcXXVJC7r33noPeifmrEH1fkobWVHhS1X7D23JTkToVacj9IGi45zfz@mkxm6HoN94sCASvinpfqfmn4F1/uy5KqQpQwELHQQZItd3Xu0zlWRTnkELbhhTCjoJ@31OIKTycCYtBSCgS8GH4RJO81qIJAd0rY2HL39SpH3nR2AZbL4dmqx/9GDoYWlhsEAxdTCOTEyq2JfHVO3zDGVAyqV3YGvRHyIkwjvSP6jgxtxR2HTcT2OxrOwJ9/cfPOx6D1586Vny8SEU8aB0AnD@QYY64AiAfFYcgkCYHoBMHpI4tZM6PeoV6Sez4Ze7ZTAmkgpsUDt4QA2wrdJfEvVuDOc/KpaAoHChUtqp43xWjHXHE3by5Q6pzOqfvsyzMKWSnhTpFF7ZpTJpVstF0Yy5IeiZW/vd8Ledsfa7FPmf9YXHy/As "C (gcc) – Try It Online")
[Answer]
# [Scala](http://www.scala-lang.org/), 51 bytes
Modified from [@Roberto Graham's Java answer](https://codegolf.stackexchange.com/a/141971/110802).
Golfed version. [Try it online!](https://tio.run/##HcyxCoMwEIDh3ae4McEreNFKrY3g2KFPUDpcbYSUECUGaRGf3Uqn/5v@qWPH2/B8my7Cja0H84nGvyZoxxGWJEkAZnZgztCGwN/71ccH6Ab2goaNdbPMHMDqrO6HINzlwNL2wh1YWNkUksViU021XaV2tU1p3QDGYH10Xhjxn4oMCQs8YoVESAqpQCqRTqhyVAWqEtXuCvNMSpms2w8)
```
a=>{var i=0;for(l<-a)if(l-a(i)>4)a({i+=1;i})=l;i+1}
```
[Answer]
# [Japt](https://github.com/ETHproductions/japt), ~~14~~ 12 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
```
Ê©ÒßUfÈ-UÎ¨5
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yqnS31VmyC1Vzqg1&input=WwpbMF0KWzAsMyw1LDddClswLDMsNCw3LDksMTAsMTEsMTJdClswLDMwLDEyMF0KWzAsNCw4LDEyLDE2XQpbMCw0LDgsMTIsMTYsMjBdClswLDEsMiwzLDQsNSw2LDcsOCw5LDEwLDExLDEyLDEzLDE0LDE1LDE2LDE3LDE4LDE5XQpbMCw1LDEwLDE1LDIwXQpbMCwxLDIsMyw0LDUsNiw3LDgsOSwxMCwxMSwxMiwxMywxNCwxNSwxNiwxNywxOCwxOSwyMF0KWzAsMSw0LDUsOSwxMSwxMiwxNCwxNiwxOCwyMywyNCwyNiwyOCwyOSwzMF0KXS1tUg)
[Answer]
# [Nekomata](https://github.com/AlephAlpha/Nekomata), 7 bytes
```
ˡ{C4+>‼
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m70iLzU7PzexJHFZtJJurlLsgqWlJWm6FqtOL6x2NtG2e9SwZ0lxUnIxVHjBzc_RBrFc0QY6xjqmOuZQlomOuY6ljqGBjqGhjqERRBDIMYKoNNGxALJ1DM1QeTpQaUMdI7ARpjpmQGMskAzSMTTWMTTRMTQFqTY01zEE6rQE6zEFqzEl0wiENpAWS5hKE7AaCx0jYx0jEx0joAOBbEugT2IhfgcA)
A port of [@Zgarb's Husk answer](https://codegolf.stackexchange.com/a/141957/9288).
```
ˡ{C4+>‼N
ˡ{          Iterate the following block until it fails, and counts the number of iterations
  C           Split the list into its head and tail
   4+         Add 4 to the head
     >‼       Filter the tail by whether it is greater than the head + 4
```
]