[Question]
  [
## Context
After attempting to program in [Grass](https://esolangs.org/wiki/Grass) for the entire morning, you decide to go outside and mow some *real* grass. The grass can be viewed as a string consisting exclusively of the following characters: `wWv`. `w` denotes tall grass which takes \$ 1 \$ unit of energy to mow. `W` denotes *extremely* tall grass which takes \$ 2 \$ units of energy to mow. Lastly `v` denotes short grass which does not need to be mowed. 
## Task
You decide to mow the grass from left to right *(beginning to the end of the string)*. However, every time you encouter a `v` *(short grass)*, you stop to take a break to replenish your energy, before carrying on with the mowing. Your task is to calculate the maximum amount of energy expended while mowing. In other words, find the maximum total energy of mowing a patch of grass, that of which does not contain `v`.
### Example
In the example input below, the answer is \$ 8 \$. Although the patch `wwwwwww` is a longer patch of grass, it only costs \$ 7 \$ units of energy, whereas the optimal patch `WWWW` expends \$ 2 \times 4 = 8 \$ units of energy.
```
Input: WwwvWWWWvvwwwwwwwvWwWw
Output: 8 
```
Here is an example Python program -> [Try It Online!](https://tio.run/##hY6xDsIgFEX39xV3o8Zq1NGkbn4Do2kiVZIWG0Be/fr6oDo4eROWcy4Xxle8P9xhnq@mQ1eF1ZFw820IaBC2YextrFRSK8IwCdoRuofHDdYtNanjvIhibDGZCl432MN2ApsGihVMHwwOIsvY0E7VMNU4y7o38emd8JnvtjfYy0T@g2/5Yt34jJWURm9dRKihNidVl@/OmjlpSUq8JGnWTEyaMqEsKVFaIizpcor45Hv1N38reVXefQM).
## Test Cases
```
WwwvWWWWvvwwwwwwwvWwWw -> 8
w -> 1
W -> 2
vwww -> 3
vWWW -> 6
v -> 0
vvvvvvv -> 0
vwvWvwvWv -> 2
vWWWWWWWWWWvwwwwwwwwwwwwwwwwwwwwwv -> 21
vWWWWWWWWWWvwwwwwwwwwwwwwwwwwwwv -> 20
vvWvv -> 2
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins!
  
[Answer]
# [Python 2](https://docs.python.org/2/), 49 bytes
```
lambda s:len(max(s.replace("W","ww").split('v')))
```
[Try it online!](https://tio.run/##hY3BasMwDIbvfgrhS21Iw5rBGIX0NXzZxVsTZnAcIxl7ffrMirPBTvtB6Jf0SYqP9LmGYZvHt83b5f1uga5@CmqxX4p6nKK3H5OSRnayFKl7it4ldconrfXmlrhiAnqQmFcE78IELnDdU7q7cBUA1IENBCMsNipKWCfoYrfDxzV5vkmtK9tAF5KqjhtYy1ntNmLtA3aA41inmyklm6qcS1M2xRQ43@BV7OkiDKdBMMDuWfACuxeROT2J3HQU9cQex5r51c@Lv2rc5T@wYfzLtE/DNw "Python 2 – Try It Online")
Here's how it works:
1. Replace each `W` with `ww`
2. Split on `v`'s to produce chunks of consecutive `w`'s
3. Take the `max` to get the longest one
4. Get its length
[Answer]
# [Python 3.8](https://docs.python.org/3.8/), ~~55 46~~ 44 bytes
*Thanks @xnor for saving 2 bytes!*  
*Thanks @dingledooper for saving 2 bytes!*
```
lambda s,t=0:max((t:=c%2*t+c%5%3)for c in s)
```
[Try it online!](https://tio.run/##hY3RasMwDEXf/RXCEHC2prQNGyGQ/oYftj2kaUMNiWNszVkI@fbMirvBnnbBSL46ujIT3gedF8aubfW@dnV/udbgdlgdyr7@EgLLqklOT/jcJC9JnraDhQaUBpeuqjeDRXCTY2R3St@2yeT2Dq9KlwxCEtTaQQV9bYRDGyZWmd0G753pFAqenXmaBjaCSqMIHRn0vUx4cyLE8E9ss4KTb4Pfig0xlviWz26B7AyzXeBtDvOK0pYPnq5yHL0M8n6M8nKUI8EF28qRSSonRgB1OaMF6l6Zp3JgPurxCRHbe6zJX/2c@KvIHf8DI0a3ZLx0@gY "Python 3.8 (pre-release) – Try It Online")
A function that takes in a byte string, and returns the max energy.
---
Cool trick with `eval`.
## [Python 2](https://docs.python.org/2/), 61 bytes
```
lambda s:max(eval("+".join(s+"v").replace("v","0,")))
w=1;W=2
```
[Try it online!](https://tio.run/##hY3BbsMgDIbvPIXFiag0ajJpmlrR1@CyC1sTjYkQZBCsT5@Z0E3aab@E/P/msx3u6WP14zar182Z5e1mIJ4X8yWmbJzgB95/rtaLeOCZdz1OwZn3SVCQ/CR513WsqOGi1bjZJayYIN4jm1cEZ/0E1tfcx3Sz/swAogTjIyhYTBAxIf2gDXKH@xicTYIfr7SW2AZanwS52kCKs9htQOoDSkCl6HfTpWRNyrk0ZV10geMVXtheBqZrGVkFqntidaC6Z5ZrObHc9Ai0Yn@PMf2rnxN/1bjhP7Bh9ZZul8Zv "Python 2 – Try It Online")
Transforms the given string by adding `+` between characters, then replaces `v` with comma (e.g `wWvW -> w+W+0,W`).
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~9~~ 8 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
O’%3ṣ0§Ṁ
```
**[Try it online!](https://tio.run/##y0rNyan8/9//UcNMVeOHOxcbHFr@cGfD////w8vLy8KBoKysHALKwsvDywE "Jelly – Try It Online")**
### How?
```
O’%3ṣ0§Ṁ - Link: list of characters   e.g. "wwwvWvwWww"
O        - ordinals                        [119,119,119,118,87,118,119,87,119,119]
 ’       - decremented                     [118,118,118,117,86,117,118,86,118,118]
  %3     - modulo three                    [1,1,1,0,2,0,1,2,1,1]
    ṣ0   - split at zeros                  [[1,1,1],[2],[1,2,1,1]]
      §  - sums                            [3,2,5]
       Ṁ - maximum                         5
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 50 bytes
```
s=>Math.max(...Buffer(s).map(c=>e+=c%5%3||-e,e=0))
```
[Try it online!](https://tio.run/##ldFND4IgGAfwe5/CubnBStRarQseunfm7Ax6mYkTgw5@d4OcbSor@m9cGD/2vNwymYm8vlZNWPIT7RjuBE6PWXNB9@wJEEKHB2O0BgLqiwrkOKVLnAfbYNO2IV1RHEPY5bwUvKCo4GfAgE@UkkRHStVHEkWUD6E3ShR5@8WEzl9Zo2kypcSZrqfU1OmgNd3MqO7Tje5m1LngeEb7/PrASvU23uc7to6JfDJsdpz@T0OTP@1QjbGWbol0GJax3Qs "JavaScript (Node.js) – Try It Online")
Or **42 bytes** if we can take a Buffer (or an array of ASCII codes) as input:
```
s=>Math.max(...s.map(c=>e+=c%5%3||-e,e=0))
```
[Try it online!](https://tio.run/##ndJNC4MgHAbw@z5FBIGyZbXY2MUOu@/sWZruhZZRTXfouzdbWxBkyR4QPMiPv4/eqaRVWt6K2s/FmbUctxVOTrS@ogd9AYRQpTcFSHHC1jj1dl7cND7bMBxC2KYir0TGUCYugIPjk3NWApcoJYmOlKqPJIooF0LojBIEzmE1TUycnowmIgNB7Imtgejmt1E0EZsI3YMlsTcR9hcJTUSfRWiO0K/4WQvIXJ1kyO9njPO1OyL6zxim6wxzG0TalNoZ7Rs "JavaScript (Node.js) – Try It Online")
[Answer]
# [K (oK)](https://github.com/JohnEarnest/ok), ~~19~~ ~~18~~ 13 bytes
**Solution:**
```
|/+/'3!5!"v"\
```
[Try it online!](https://tio.run/##y9bNz/7/v0ZfW1/dWNFUUalMKUYpvLy8LBwIysrKIaAsvDy8XOn/fwA "K (oK) – Try It Online")
**Explanation:**
Might be further golfable...
```
|/+/'3!5!"v"\ / the solution
         "v"\ / split on "v"
       5!     / modulo 5 (turns "vwW" into 3 4 2)
     3!       / modulo 3 (turns 3 4 2 into 0 1 2)
  +/'         / sum (+/) each (')
|/            / take maximum
```
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 12 bytes
```
Ｉ⌈Ｅ⪪Ｓv⁺Ｌι№ιW
```
[Try it online!](https://tio.run/##JYyxCoRADER/5dgqgn7BlVYHCoJF6kUODazrotnEv4/h7hUzDDPMssVzOWIym07KDH28GMZ401539wJzScTwyaXyzD5ZoWlfQYLrlOoFwzevvAF57o/qD@Q1hubH2wxVBR0R/SOoqNZJegA "Charcoal – Try It Online") Link is to verbose version of code. Explanation:
```
    Ｓ           Input string
   ⪪ v          Split on literal `v`
  Ｅ             Map over chunks
          ι     Current chunk
         № W    Count of literal `W`
      ⁺         Plus
       Ｌι       Length of current chunk
 ⌈              Maximum
Ｉ               Cast to string for implicit print
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell) 6+ for Windows, 48 bytes
port of [math junkie's](https://codegolf.stackexchange.com/a/204443/80745) answer for Retina.
```
$args-creplace'W','ww'-split'v'|% len*|sort -b 1
```
[Try it online!](https://tio.run/##jVDLCsIwELznKxZJTSstWAURQfAvcpRa1wcErUlNBNtvr9vEKt4cCMxkZnZhq6tDbU6oVMcPsIZnxwt9NFmpsVJFiUKKVDgnMlOpcy2saCJQeJk05qpryHaQdy1jm5ilsZDOWUmw1gVY6aQTKSyT3u5Z7hnNhJlnfZLEPAjqklgEQWwaWMBX01z/vlPkB8PqX/ho/k/WJ4e90r53JNBABE8GBH7UhTEpcHxUWNa4p6vxbbA0mruq6WNMxwxBb4x4/PYyvH2KyWpojFjbvQA "PowerShell – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~19~~ 17 bytes
-2 bytes thanks to @Neil!
```
W
ww
S_`v
O^`
\Gw
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wP5yrvJwrOD6hjMs/LoErxr38///w8vKycCAoKyuHgLLw8vByrnKucC6QCBdIkquMqwwCgGJl4WAMloACmFZUQFAJyFSgvQA "Retina 0.8.2 – Try It Online")
Replaces `W` with `ww`, splits at `v`, sorts by length, then counts the `w`'s in the largest chunk.
[Answer]
# [J](http://jsoftware.com/), 26 21 bytes
```
[:>./0+/;.1@,3|2+3&u:
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o63s9PQNtPWt9QwddIxrjLSN1Uqt/mtypSZn5CtYKNgqpCmoh5eXl4UDQVlZOQSUhZeHl6tD1BhC1MC4RlAtUK4xhAvSCBUxg4oAzYOKGEBF0LgQgGpsGdBqMIYJGyJMgwKYG1EBXIMBURrQrQXaWKb@HwA "J – Try It Online")
* `3&u:` Change input to unicode int values
* `3|2+` Add 2 and then mod 3: Now `v` becomes 0, `w` becomes 1, and `W` 2.
* `0...,` Prepend 0
* `+/;.1` Split by first element (0) and sum the elements of each split chunk
* `[:>./` Take the max
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 21 bytes
```
(((⌈/+/¨)×⊆⊢)'vwW'∘⍳)
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/zU0NB71dOhr6x9aoXl4@qOutkddizTVy8rD1R91zHjUu1kTpBaokqA69bJwOCgrxwbK1P8DAA) Assumes IO is 0.
**How it works**:
* we convert `v`, `w` and `W` into `0, 1, 2` respectively;
* we split on 0s;
* we sum each run of non-zeroes;
* and find the max of those.
[Answer]
# [Haskell](https://www.haskell.org/), 51 45 bytes
-6 bytes thanks to [Ad Hoc Garf Hunter](https://codegolf.stackexchange.com/users/56656/ad-hoc-garf-hunter)! Unfortunately all the grass-like operators were already taken :(
```
g=maximum.scanl(#)0
x#'w'=x+1
x#'W'=x+2
x#_=0
```
[Try it online!](https://tio.run/##hY3BDoIwEETv@xUbMUFCMOjZ@gXcjOnRNNoAkRZDoeXv67ZoIicnaTOdtztthHnKrvO@ZkrMrZrU3tyF7nZJVsKcpC5lc34Ijgd3JHdjpa/leDVyqFotDTJ89ICkjp54KpBoIDF7TeNlHCqN2wXnOW6wONNFzjS9w10dSRbHf4sBlGh1rF/lnjtnOclat8hyxx044BASCBAs2EWUWR5PBB99V9f6OxJa6d83 "Haskell – Try It Online")
**Explanation**
`scanl` is basically a "running total", where for each element of a list, it applies a function to the element and an accumulator, and saves the accumulator at each step. So `scanl (+) 0 [1,2,3]` gives `[0,1,3,6]`. We're giving it the function `(#)` which we've defined to add `1` to the accumulator if the element of the list is `'w'`, add `2` to the accumulator if it's `'W'` or set the accumulator to `0` if it's anything else (`'v'`). Then we just get the maximum number of the new list, which will be the largest sum we managed to accumulate.
Cool idea I couldn't get to work:
`mapping = zip "vwW" [(*0),(+1),(+2)]`
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), 9 bytes
```
C‹3%0€v∑G
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=C%E2%80%B93%250%E2%82%ACv%E2%88%91G&inputs=WwwvWWWWvvwwwwwwwwvWwWw&header=&footer=)
Port of the Jelly answer. Update: Bug has been fixed.
```
C         # To array of charcodes
 ‹        # Decremented
  3%      # Mod 3
    0€    # Split on 0s
      v∑  # Map to sum
        G # Maximum
```
## Other approach, 10 bytes
```
\W₀V\v/vLG
```
[Try it Online!](http://lyxal.pythonanywhere.com?flags=&code=%5CW%E2%82%80V%5Cv%2FvLG&inputs=WwwvWWWWvvwwwwwwwwvWwWw&header=&footer=)
```
   V       # Replace...
\W         # 'W'
   V       # With...
  ₀        # 10 (arbitrary 2-byte value)
      /    # Split on...
    \v     # 'v'
       v   # Map each to...
        L  # Length
         G # Maximum
```
-2 from this thx to @DLosc.
[Answer]
# [Perl 5](https://www.perl.org/) with `-p0166 -l -MList::Util+max` , 22 bytes
```
$\=max$\,y///c+y/W//}{
```
[Try it online!](https://tio.run/##K0gtyjH9/18lxjY3sUIlRqdSX18/WbtSP1xfv7b6///w8vKycCAoKyuHgLLw8vDyf/kFJZn5ecX/dQsMDM3MFHRz/uv6@mQWl1hZhZZk5mgDjQIA "Perl 5 – Try It Online")
### Explanation
`-p` reads `STDIN` into `$_` breaking on each `$\`, `-0166` sets `$\` to `v` and `-l` strips `$\` from the end of each `$_` and enables automatically printing `$\` when printing the output.
This stores the larger of `$\` (initialised to `v` which is `0` when compared numerically) or `y///c` (which 'replaces' the empty set of characters with the empty set of characters for every character in the string, returning the `c`ount) added to the number of `W` in the string.
Since `$\` is globally scoped, storing it here lasts for each iteration of the script the `}{` breaks out of the `while (<STDIN>) {` loop that `-p` inserts and terminates it so that instead of the current value of `$_` being printed alongside `$\`, `$_` is empty and only `$\` is printed.
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~69~~ \$\cdots\$ ~~62~~ 60 bytes
Saved 5 bytes thanks to [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld)!!!  
Saved ~~2~~ 4 btes thanks to [dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper)!!! 
```
e;m;f(char*g){for(e=m=0;*g;m=m>e?m:e)e=*g%2*e+*g++%5%3;e=m;}
```
[Try it online!](https://tio.run/##jVBNa8MwDL3nVwiDwU5caFJWxjx3P8OHpYeSOp4PzooTkkHIb8/kfBR220NCtqT3EK862KqaZyO9rFn1dQup5WP9HZhRXh1laqVX/mI@/JvhRqWWFqnJUptl9IWeJC7JafY31zAOYwKIRQM603bt5xUUjEQPQ68RfT@s6PWgByJITI0Z@7HgTiwxVyyzXi@5LWzYpf7iH0urOt5CJrnc65oOzM9jvfVVQC6gEHAScBZwXAK/RezG50aKBkWiQ4vAvee5hCxzuwW7bEDJmq1WuCuXz@Ej4LhmpCS0LQkcLkDvwOidlw0RsBMEBAyl4nVP@pRMyfwL "C (gcc) – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 8 bytes
Port of the Jelly answer.
```
Ç<3%0¡Oà
```
[Try it online!](https://tio.run/##yy9OTMpM/f//cLuNsarBoYX@hxf8/x9eXl4WDgRlZeUQUBZeHl4OAA "05AB1E – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-naFv`, 35 bytes
`-naFv` enables input on STDIN with auto-split on `v` into the `$F` global array.
```
p$F.map{|w|w.gsub(?W){11}.size}.max
```
[Try it online!](https://tio.run/##KypNqvz/v0DFTS83saC6prymXC@9uDRJwz5cs9rQsFavOLMqtRYoV/H/f3h5eVk4EJSVlUNAWXh5eDlXOVc4F0iECyTJVcZVBgFAsbJwMAZLQAFMKyogqARkKtDef/kFJZn5ecX/dfMS3coA "Ruby – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 9 bytes
```
ṣ”v<”w‘§Ṁ
```
[Try it online!](https://tio.run/##y0rNyan8///hzsWPGuaW2QCJ8kcNMw4tf7iz4f///@Hl5WXhQFBWVg4BZeHl4eUA "Jelly – Try It Online")
# Explanation
```
ṣ”v<”w‘§Ṁ  Main Link
ṣ”v        Split on "v"
   <”w     Check if less than "w" ("w" = 0, "W" = 1)
      ‘    Add one to every element
       §   Sum every sublist
        Ṁ  Find the maximum
```
[Answer]
# [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), ~~85~~ ~~82~~ 69 bytes
```
{FS="v";gsub("W","ww");for(;i<NF;){s=length($++i);m=m>s?m:s;}print m}
```
[Try it online!](https://tio.run/##JcG9DkAwEADgV5GLoQ1P4JTNaDHcTOKnoYhyN4hnL4nva2UO4a4aAww4@qtTQJCCCGgctkOhzesK9e3N0q/jOak4SaxGZ1zhS5d5fPbDrmfknhBIhOnDLD8mIXkB "AWK – Try It Online")
Thanks to [@dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper) for cutting off 13 bytes.
The code could be even less, **62 bytes** accounting for the field separator flag being a parameter and not part of the actual code.
pretty straightforward: change all `W` into `w`, get lenght of words, `v` counts as field separator. Retain max score with ternary operator.
[Answer]
# [Java (JDK)](http://jdk.java.net/), 62 bytes
```
s->{int m=0,n=0;for(var c:s)m=(n=c%2*n+c%5%3)>m?n:m;return m;}
```
[Try it online!](https://tio.run/##hU89a8MwEN3zK46AwU4aE1q62LVLKBQ6dErBQ8igKnEq15KMdJYwwb9dlR13CIX0wSHu3sfpKmLIqjp8O8YbqRAq38ctsjpepLM/s7IVFJkUA0lrojW8EybgPANo2s@aUdBI0D9GsgNwz4VbVEycdnsg6qSjUQrwId8Evk5hT/SLqN0@hxIycHqVn5lA4Nn6TmTrtJQqNEQBTXTEs1BkNLhfiCUNHoOHKOfPIuGpOmKrBPC0d@mY700wuvzS5GozwLbTeOSxbDFu/NewFuEcYA7LQRelN1T5qCpj0jR1t9H@hNBbYpQv/oCNUqQLo@hWwsT1s6F65wprTeFhjL3AFLawzrrCDRM3kM44c4GfmWKskZjwa73Gv5Ih1e/9AQ "Java (JDK) – Try It Online")
After finishing it, it seems to be a port of [Noodle9's C answer](https://codegolf.stackexchange.com/users/9481/noodle9).
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 69 bytes
```
Func<string,int>g=s=>s.Replace("W","ww").Split('v').Max(x=>x.Length);
```
[Try it online!](https://tio.run/##JYxBCsMgEAD/4iUKqR9o9VLoKb20B89BFrsgm5C1rr83QuY8M5FvkbH315/ig8uBlGak4pNj59l@YM9rBK2CmpWIMva7Zyx6qpOx77Xp5nyzC1AqP3Pvz414y2DDgQUWJNBppCI1DGqVixokjNXwTw "C# (Visual C# Interactive Compiler) – Try It Online")
Heavy inspiration from [@xnor](https://codegolf.stackexchange.com/a/204449/87760)
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 28 bytes
```
sed 's,W,ww,g;y/v/\n/'|wc -L
```
Input from stdin, output to stdout
There might be a better way.
[Try it online!](https://tio.run/##S0oszvifpqGpUP2/ODVFQb1YJ1ynvFwn3bpSv0w/Jk9fvaY8WUHX538tF1dqcka@glJ4eXlZOBCUlZVDQFl4eXi5kkKNQtp/AA "Bash – Try It Online")
[Answer]
# Mathematica, 53 bytes
```
Max[#~(s=StringCount)~"W"+#~s~_&@StringSplit[#,"v"]]&
```
More readable, un-golfed code:
```
Max[StringCount[#,"W"]+StringCount[#,_]&[StringSplit[#,"v"]]]&
```
`StringSplit[#,"v"]` takes a string and turns it into a list of strings, seperated by 'v', then add together the length of the string, and the count of 'W's, and take the max value.
[Answer]
# [Crystal](https://crystal-lang.org/), 57 bytes
```
def f(a);a.split('v').max_of {|s|s.count('W')+s.size};end
```
[Try it online!](https://tio.run/##rZPBTgMhEIbv@xQTLtuNWeJqYkz6IBwbZGcryRa2DAtW67Ov1KoJjResf8JlMv/H8APKHcjLcVl6HGBYyWYtOU2j9qs61A3fyZeNHeDtSEfiys4m1UXd3BAn/YrvazT94nA/a4fAaELFqqpHUk4/pcLORm22GzTotgcGva0AtAc2SSIkkErh5KVRCB7JQ/fVAmkQJmIMIimEeFYQUUTWcHq289gD7uEx9aYBCqC5vyv2i8x/V@w/nSVD3JcjUiYZ4qEckflvy/1nXUtJN/q5rs1U/Oj7qeS62KD77x0u@H/JU4TfUzh9r6VtjW2VHa37AA "Crystal – Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 70 bytes
Comprehensive approach.
```
lambda n:max([sum([2if i=="W"else 1for i in x])for x in n.split('v')])
```
[Try it online!](https://tio.run/##NcqxDsIgEIDh3ae4sMAtJnY04TkYageMJV4CV1KQw6dHG@M/fcOf3/W58TSCvY3o0/3hga/JdzOXVzLzRAHIWuXUGssKl7DtQEAMfcHD/TCfS45UjW4aFxx5J64mGOVEmvvWmvxqTpwoxNN/0aIRxwc "Python 2 – Try It Online")
[Answer]
# [Rust](https://www.rust-lang.org/), 67 bytes
Port of [xnor's answer](https://codegolf.stackexchange.com/a/204449/95013)
```
|s:&str|s.replace("W","ww").split('v').map(str::len).max().unwrap()
```
[Try it online!](https://tio.run/##hU/LbsMgELzzFZSDA5LrDyBKf6IHLpUityEWKsYIMLRy/O3u2vjRnjoSCHZnZmdd78N0N7itlaEMDwgDtAy4wZfp4Xnhg3v4ykmr6w9JiSAlSYmwylutAj3FE6va2lKgca6lmX9flFW9SQ7KbDpnx66zq/k2oO0DVsbCfcGvwSnTcG5kouy803y4ca46zuExx4MY9e2qlZG02OXHrEOo7rlXKX@VrQ3f@2ob3sHq8xCMh3SNlPX73m@GlJiQXzMsRA7aPFEyjPj5BQ8jMBZViRta5Gwrf0TjJFKKAhBjyogiiYQSEmiuoLmJIooZUItiOUtjxSb9i38psyvM/QE "Rust – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 14 bytes
```
π├♦.8Σ0└ó?∟X≈Æ
```
[Try it online!](https://tio.run/##ASQA2/9zdGF4///PgOKUnOKZpi44zqMw4pSUw7M/4oifWOKJiMOG//8 "Stax – Try It Online")
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 13 bytes
```
MX#*YaR'Wt^'v
```
[Try it online!](https://tio.run/##K8gs@F@drldcq1f93zdCWSsyMUg9vCROvex/rYKvQvr/8PLysnAgKCsrh4Cy8PLwcq5yrnAukAgXSJKrjKsMAoBiZeFgDJaAAphWVEBQCchUoL3/dYtycDgDAA "Pip – Try It Online")
### Explanation
```
     a         First command-line argument
      R'W      Replace all occurrences of W
         t     with 10 (arbitrary value--the important thing is, it's two characters)
          ^'v  Split on occurrences of v
    Y          Yank (to enforce precedence)
  #*           Replace each string in the list with its length
MX             Take the maximum
```
[Answer]
# Excel, 101 bytes
```
=MAX(LEN(SUBSTITUTE(FILTERXML("<a><b>x"&SUBSTITUTE(A1,"v","</b><b>x")&"</b></a>","//b"),"W","ww"))-1)
```
[Link to Spreadsheet](https://1drv.ms/x/s!AkqhtBc2XEHJnDnePjbAK85_20_N?e=t637DY)
* `"<a><b>x"&SUBSTITUTE(A1,"v","</b><b>x")&"</b></a>"` converts text to
XML containing "x" + the "wW" strings. The additional "x" prevents
errors.
* `FILTERXML(~,"//b")` converts XML to a vertical array.
* `SUBSTITUTE(~,"W","ww")` change "W" to "ww".
* `LEN(~)-1` counts the "w"; minus 1 for the leading "x".
* `MAX(~)` return the largest one.
]